I am working on a codeless solution in InfoPath 2010 (qRules is not an option) and I have a nested XML structure like the following:
- root
- services (group)
- service (repeating group)
- serviceId
- serviceTitle
- commitments (group)
- commitment (repeating group)
- ...
- elements (group)
- ...etc.
I am displaying the commitment nodes using a filtered repeating table. The user selects the serviceTitle (value: serviceId) from a drop down list box bound to root/elements/serviceId, and the repeating table bound to the root/services/service/commitments/commitment filters the commitments displayed to just the select service with the following filter:
../../my:serviceId = ../../../../my:elements/my:serviceId
What I can't figure out is behavior that occurs when I select the 2nd service in the document (any service that is not the first) and start adding commitment records via the repeating table. If I insert records using the Insert Before and Insert After commands, the new commitment is created with the filtered service node. However, if I use the "Insert item" command at the bottom of the repeating table, InfoPath appends the new commitment element to the first service element. The new commitment displays on the filtered list, but then when I refresh the filter or switch services, the new record displays when the first service is selected.
The "Insert item" hyperlink is very useful because it is the next control in the tab order. So a user doing data entry can add records without mouse clicks, whereas the Insert before and after commands require mouse clicks. I have done a couple days worth of experimenting and web research and can provide more details of the behavior, if needed. However, I'm at the point where I'm thinking perhaps this is a well understood behavior of InfoPath. So, I'm wondering if someone on this forum can explain the fundamental behavior of "Insert item" and why it makes sense that the new commitment node is appended to the wrong service node?
Best, Simon