- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 05:54 AM
Hey guys,
I'm currently creating a UI page and using <g:ui_choicelist>, the parameters I have are name, table and field.
I was wondering if there was a way to set the value of this choicelist? It always defaults to the first in sequence?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 06:01 AM
Hi Fraser,
I have a ui page where i did create a dropdown, its the simple HTML code and its working just fine:
<select id="approvers" onchange="test()" style="width:200px">
<option value=''> -- None -- </option>
<option value='a'> A </option>
<option value='b'> B </option>
</select>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 06:01 AM
Hi Fraser,
I have a ui page where i did create a dropdown, its the simple HTML code and its working just fine:
<select id="approvers" onchange="test()" style="width:200px">
<option value=''> -- None -- </option>
<option value='a'> A </option>
<option value='b'> B </option>
</select>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 06:05 AM
Hi Anurag,
Thank you for your reply.
I am trying to use the choicelist(s) defined on a table elsewhere, I have considered manually creating an HTML drop down but using ui_choicelist would save me some lines of code for that as there will be a few!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 06:14 AM
in my code also the choice values are not hardcoded, its coming from db only...here is the full code
<g:evaluate jelly="true" object="true">
var GR = new GlideAggregate("<table name>");
GR.addQuery("<field name>", '${sysparm_sysID}');
GR.groupBy("<field name>");
GR.query();
</g:evaluate>
<tr align="center">
<td id="description" align="right" >Select Approval Name:</td>
<td id="approvers" >
<select id="abc" onchange="test()" style="width:200px">
<option value=''> -- None -- </option>
<j:while test="${GR.next()}">
<option value = "${GR.<field 1>},${GR.<field 2>}" > ${GR.<display field>} </option>
</j:while>
</select>
</td>
</tr>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 06:17 AM
Thanks, I've tried using the HTML select just to see if it works.
Only problem is <option value="" selected> </option> doesn't seem to be working, does Jelly not support preselected values for the dropdowns?