Adding loop to render form elements runtime in ui page html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2017 10:04 PM
Hi Experts,
Do anyone have any idea about, how can i add repeated form elements via loop
I have created ui page on that one reference field i want to be created runtime, anyone have any idea how can i do that?
Regards,
Amol Bavaskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2017 10:30 PM
You can do that using javascript.
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div id="container"></div>
</j:jelly>
Client Script
var container = document.getElementById("container");
for (var i = 0; i < 3; i++) {
container.innerHTML += '<div class="box"></div>';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2017 11:04 PM
Hi kannan,
Can we do it Html itself because i have a table in html in which i am rendering the contents as below
<tr>
<td nowrap="true">
<g:ui_reference name="assignment_group3" id="assignment_group3" table="u_rc_assignment_group_mapping" value="" onchange="checkAsignee(3)"/>
</td>
<td nowrap="true">
<select id="assign_to3" name="assign_to3">
<option value="">---Select---</option>
</select>
</td>
<td nowrap="true">
<input name="notes2" id="notes2" value=" " />
</td>
</tr>
I want this tobe repeated in loophow can we do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2017 12:33 AM
Hi Amol,
I tried but the loop is not executing more than once. If I remove the reference field then it is getting executed properly. Not sure why 😕
Thanks,
Kannan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2017 12:56 AM
Hi Amol,
We can achieve this using the <j:while> (Jelly tag) in a UI page. Could you share a little bit more on the requirement.