- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2017 07:45 AM
I'll prefix this by saying I know just enough about Jelly to be dangerous. I'm trying to add some text input fields on a UI Page. Right now it's limited to 10 fields, but it may change to another number and I'm planning on switching it to a property later on, but just want to get this to work as is with a hard coded 10 items:
<j2:set var="jvar_serialnumbers" value="1" />
<j2:while test="$[jvar_serialnumbers != 10]">
<tr class="item" id="extra_lines2_$[jvar_serialnumbers]">
<td colspan="6"></td>
<td colspan="2">
<label>Serial Number</label>
<input type="text" size="14"
name="serial_$[jvar_serialnumbers]"
id="serial_$[jvar_serialnumbers]"
value="serial_$[jvar_serialnumbers]"/>
</td>
</tr>
<g2:evaluate var="jvar_serialnumbers" expression="jvar_serialnumbers=jvar_serialnumbers+1;" />
</j2:while>
I thought this should work, but only 1 field is being added. I originally tried:
<j2:while test="$[jvar_serialnumbers ${AMP}lt; 10]">
on line 2 but it gives me the following error: Error at (125, 53): null:-1:-1: <null> Unable to create expression: jvar_serialnumbers < 10
Any help would be appreciated.
Solved! Go to Solution.
- 3,087 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2017 08:45 AM
Within the while loop the g2:evaluate should instead be another j2:set
<j2:set var="jvar_serialnumbers" value="$[jvar_serialnumbers + 1]"/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 02:43 AM
Hi,
I have used your idea to programmatically create 10 reference fields in my ui page.
Now I have to recall the contents of this fields in the processing script, how can I do?
Thanks,
Alessio