How to fetch input hidden value into jelly script??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 05:43 AM
Hi,
I have an input hidden field
<input type="hidden" id="mytext" value="dummy" />
I want to fetch the value into jelly tag.
I tried this :
<g:evaluate var="jvar_notes_text"
expression ="RP.getWindowProperties().get('mytext')" />
Then i printed the variable as ${jvar_notes_text}. But its giving null.
Please help on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 06:34 PM
Hi Priya, the parsing of a jelly code occurs a little bit differently. In a nutshell, a jelly code is composed of two main elements:
a) the code that runs in the server side which generates the html that will be passed to the client
b) the resultant code that runs in the client side
Only the jelly code is the one that's executed in the server side and it's the one that is converted into html/client side script code that can be run on the client side in the browser. On this case, the input html tag is just text and it's not evaluated when the jelly script is executed in the server side. What gets evaluated is the actual jelly code that's within the <g: and <j: elements. For this reason your jelly code cannot access the hidden input value.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 11:25 PM
The following should be helpful:
TechNow Episode 1 | ServiceNow Jelly Scripting Part 1 of 3 - YouTube
Extensions to Jelly Syntax - ServiceNow Wiki
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 11:29 PM
Thanks for the reply . Hey have you tried creating new cart layout which only displays for cms and not for legecy service now ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2015 10:42 PM
You're welcome priya. What do you mean by leagacy ServiceNow?
Please consider marking this thread as closed by marking the responses as helpful/correct if you feel your thread question was answered.
Thanks,
Berny