[Xsltforms-support] Issue with repeat index after replacing instance
Brought to you by:
alain-couthures
From: Tim T. <tim...@gm...> - 2015-04-13 05:59:09
|
Hello, I am running into an issue with repeat indexes when instance data has been replaced by a submission (running XSLTForms 609 in eXist 2.2). I send a query to the database: <xf:input id="query" ref="instance('search')/query" incremental="true"> <xf:label>Search</xf:label> <xf:action ev:event="xforms-value-changed"> <xf:send submission="submit-search"/> </xf:action> </xf:input> The submission that handles this replaces the instance data: <xf:submission id="submit-search" resource="/exist/restxq/query" method= "get" serialization="application/x-www-form-urlencoded" ref= "instance('search')/query" targetref="instance('search-results')" replace="instance"/> I then output the results to a table: <table id="results-table"> <thead> <th>Field</th> <th>Value</th> </thead> <tbody> <xf:repeat nodeset="instance('search-results')/*" id= "search-results-repeat"> <tr> <td> <xf:output value="substring-after(name(.), ':')" ></xf:output> </td> <td> <xf:output ref="."/> </td> </tr> </xf:repeat> </tbody> </table> I want to be able to click on a table row and set a value, based on the current index, to send back to the server: <xf:trigger> <xf:label>Select</xf:label> <xf:action ev:event="DOMActivate"> <xf:setvalue ref="instance('search')/selected" value="instance('search-results')/*[position() = index('search-results-repeat')]/@rdf:about"/> <xf:send submission="select"/> </xf:action> </xf:trigger> However, when I replace the instance data with my first submission, the repeat index does not reset. My question is, is it possible to rebind the data so that the repeat index becomes active again, without having to do a "@replace = 'all'" on submission? Thank you! Tim |