[Xsltforms-support] Nested repeat with different instances
Brought to you by:
alain-couthures
From: Elias M. <eli...@gm...> - 2013-02-20 20:41:32
|
Hi. I'm trying to create a spreadsheet where the rows and columns are in separate instances, something like: <xf:instance id="rows"> <data xmlns=""> <row> <rowdata>stuff</rowdata> </row> <row> <rowdata>more stuff</rowdata> </row> ... ... </data> </xf:instance> <xf:instance id="cols"> <data xmlns=""> <col> <coldata>stuff</coldata> </col> <col> <coldata>more stuff</coldata> </col> ... ... </data> </xf:instance> <xf:repeat id="rows" nodeset="instance('rows')/row"> <div><xf:output value="./rowdata"/></div> <xf:repeat id="cols" nodeset="instance('cols')/col"> <div><xf:output value="./coldata"/> <xf:output value="index('rows')"/><br/> <xf:output value="index('cols')"/> </div> </xf:repeat> </xf:repeat> As you can see I'm using a nested repeat. Start with the repeat for the rows and inside the repeat for the cols. Works fine and displays fine, BUT the index gets lost when moving from one cell to another. It should show 1,1 if I click on the first cell, 1,2 in the second, 2,1 in the second row, 2,2 etc.. It does show correctly for the first few clicks, but then is gets lost if I click on cells in the same row it does not update. I do need the index to perform some actions on the cell. Any help is appreciated. Thanks Elias |