Jump to content

Xforms delete repeat item problem.


Guest AlanK84

Recommended Posts

Guest AlanK84
<books><book><type>paperback</type><title>My book 1</type></book><book><type>Hardback</type><title>My book 2</type></book><book><type>paperback</type><title>My book 3</type></book></books>

Above is an example of some xml in my xforms I am displaying all paperback books in a repeat.

<xforms:repeat id="repeatid" nodeset="books/book[type=paperback]">

This works fine and the correct books are displayed.Now i want to give the user the option to delete one of these 2 books.

<xforms:trigger>	<xforms:label>Delete Selected Book</xforms:label>	<xforms:action>	<xforms:delete nodeset="books/book[type=paperback]" at="index('repeatid')"/>	</xforms:action></xforms:trigger>

This is where things go wrong. Because there are 3 books, but only 2 are displayed if i select to delete the second paperback book it deletes the second book regardless of whether it is a paperback or not. The xml could be in any order so it very hit and miss as to whether the right item is delete.My actual xml is much more complicated than this but this example demonstrates my problem, if anyone can help it would be greatly appreciated.Alan.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...