- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 12:09 AM
Hi Experts,
Do we have any idea about how can we add while or for loop in jelly script to render following elements
<tr>
<td nowrap="true">
<g:ui_reference name="assignment_group0" id="assignment_group0" table="u_rc_assignment_group_mapping" value="" onchange="checkAsignee(0)"/>
</td>
<td nowrap="true">
<select id="assign_to0" name="assign_to0">
<option value="">---Select---</option>
</select>
</td>
<td nowrap="true">
<input name="notes0" id="notes0" value=" " />
</td>
</tr>
Regards,
Amol Bavaskar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 12:36 AM
Hey Amol,
Could you please try the below code :
<g:evaluate jelly="true" var="jvar_list" object="true">
// glide record here
}
</g:evaluate>
then in the section you have the drop down put the below code
<td>
<select name ="xyz" id="xyz" >
<j:while test="${jvar_list.next()}">
<option value="${jvar_list.getValue('fieldName')}">${jvar_list.getValue('fieldName')}</option>
</j:while></select>
</td>
Please Hit ✅Correct, âÂ��Helpful, or ��Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 12:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 12:36 AM
Hey Amol,
Could you please try the below code :
<g:evaluate jelly="true" var="jvar_list" object="true">
// glide record here
}
</g:evaluate>
then in the section you have the drop down put the below code
<td>
<select name ="xyz" id="xyz" >
<j:while test="${jvar_list.next()}">
<option value="${jvar_list.getValue('fieldName')}">${jvar_list.getValue('fieldName')}</option>
</j:while></select>
</td>
Please Hit ✅Correct, âÂ��Helpful, or ��Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2017 02:44 AM
Besides <j:while> there is also a <j:forEach> to iterate over array-like objects.
Example usage:
<g:evaluate>
var fields = ['caller_id', 'name', 'whatever'];
</g:evaluate>
<j:forEach items="${fields}" var="jvar_field_name">
<g:evaluate jelly="true">
field_name = jelly.jvar_field_name;
</g:evaluate>
${field_name}
</j:forEach>