xpathorbeonxforms

Orbeon: Access repeated grid items from a different repeated grid


There are 2 repeated grids, r1 (with inputs a and b) and r2. In r2, I would like to access values from r1. I can access the complete content of the grid by setting the calculated value in form builder to $r1. However, I only want certain fields. When I use $a I do get the value of a, but I always get the first iteration. Is there some way I can access the elements of the first grid in the current iteration of the second grid? something like $r1['a'][xxf:repeat-position()]"?

Example here: http://demo.orbeon.com/demo/fr/orbeon/builder/edit/b4efb9f927f6a9b40876e4925d90c1740c868fe8


Solution

  • I changed the expressions in the $a, $b, and xxf:repeat-position() column of your example to return what I think you wanted:

    Second grid

    Those expressions are, respectively:

    Since Orbeon Forms 2018.2, synchronizing grids is much easier. This feature will make it easier to have values copied from one grid to the other (even both ways, if needed), but also to keep the number of iterations in sync. For more on this, see the page Synchronizing repeated content.