Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Dynamic Tables and Data Service

Avatar

Former Community Member
hi :)



i have a dynamic table (with add/delete row) buttons,



one of the fields in each row, needs to populate the rest of the fields with first/last/address information.



i understand how the data service works for a single fields, is there a way to do this by adding/deleting rows?



how can i bind them? and how do i ensure that the proper row is populating?



Thanks!
5 Replies

Avatar

Former Community Member
To get the instance of the subform that you are working on you can use this.parent.index. Now when addressing the field the occurance number is on the container subform and not on the field itself. So if you had a Page1 - Subform1 - Row - Object you would use Page1.Subform1.Row[instancenumber].object.rawValue



The only issue is the the [] are illegal in javascript so you can use the syntax:



xfa.resolveNode("Page1.Subform1.Row[" + this.parent.index + "]").object.rawValue



Make sense?

Avatar

Former Community Member
hey, thanks! i understand how to get the rawData, but how do i bind it to the data service, to pre populate?

Avatar

Former Community Member
In the binding tab you can click on the repeat subforms for multiple data items.

Avatar

Former Community Member
but do i need different invokeButtons for each row? and if so, how do i bind them to each fields, in each row?

Avatar

Former Community Member
what happening now is this.



when i enter a user id in the first row, it populates fine. then i add an instance to my table, and a second row comes up. When i enter a user ID into the second row, it updates the user information in both the first and the second rows, not just the second row....