Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

choiceList bound list items

Avatar

Former Community Member
I have a repeating sub form which contains a drop down. I bound the list items to a node in my XML. Everything works fine when the form is first filled out. I can create new rows and the new rows contain the list of items in the drop down. I then save the data off and the form is rendered again later with that data. If I then add another row, the new row's drop down does not contain any items.
8 Replies

Avatar

Former Community Member
I guess it has nothing to do with the save. It only works for the fields that exist at design time. If I have 2 initial rows, then those 2 rows work. If I add one through script, the new row does not contain the items.

Avatar

Former Community Member
I bound the list items to a node in my XML through dynamic properties.

Avatar

Former Community Member
What command are you using to add the new row?

Avatar

Former Community Member
When I say add a new row, I mean a new instance of the sub form, not a new row to the drop down.<br /><br />_frmApprDetail.addInstance(1);<br /><br />I have now removed the data binding and am filling the drop downs manually through script in the initialize. I figured that the data binding would be more efficient somehow by using a common data structure for all instances of the drop down. It was not working for me though and this does.<br /><br />var objList = xfa.data.Formdata.ApproverList.nodes;<br /><br />for(i=0;i<objList.length;i++){<br /> this.addItem(objList.item(i).value);<br />}

Avatar

Former Community Member
Thats what I thought you were doing. The parameter that is used with the addInstance indicates whether you want to merge the data that is in the datadom with the new template. You have indicated true so the remerge is happening. Try changing it to 0 or false and see if it makes a difference.

Avatar

Former Community Member
I would think 1 is what I would want. I tried 0, false and true. Nothing changed it.

Avatar

Former Community Member
The drop down is actually in a table with 1 row that is inside the sub form. I am using the table to make clean columns. I'm not sure if that is contributing to the problem. It still would seem odd though that it works for the initial rows.