[Xsltforms-support] The <xf:delete> does not delete the 1st node of <xf:itemset> bound by a <xf:sel
Brought to you by:
alain-couthures
From: Kostis A. <ank...@gm...> - 2010-03-25 13:36:05
|
I think there is a problem with using the <xf:delete> to delete instance-nodes bound to <xf:itemsets> of <xf:select> or <xf:select1> controls. (lets say to clean-up the selection-lists) Although the <xf;delete> properly erases the instance-document contents, the seletion-lists are not updated corretly, and the first item is always visible in the select controls. Is this indeed the expected behavior? - Reported against XSLTForms release: beta-2 - I tested and got the same behavior on browsers: * firefox 3.5, * chrome 4 * ie8 - Also checked on Chrome revision-364 from svn and found the situation slightly worse: The <xf:select1> control preserves the old buggy behavior but the <xf:select> does not remove *any* item of it selection-list items, keeping it intact! An xform that demonstrate the problems is attached, and also included below for reference. Regards, Kostis Anagnostopouos <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" encoding="UTF-8" type="text/xsl"?> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.w3.org/2002/xforms http://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd http://www.w3.org/2001/xml-events http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd "> <head> <title>Deleting selection-list Itemset contents</title> <xf:model> <xf:instance id="main"> <main> <data /> </main> </xf:instance> <xf:instance id="items"> <items> <item>1</item> <item>2</item> <item>3</item> </items> </xf:instance> </xf:model> </head> <body> <p>xf:itemset's bound-document conents: <xf:repeat nodeset="instance('items')/item"> <xf:output ref="."/> </xf:repeat> </p> <xf:select1 ref="/main"> <xf:itemset nodeset="instance('items')/item"> <xf:label ref="." /> <xf:value ref="." /> </xf:itemset> </xf:select1> <xf:select ref="/main"> <xf:itemset nodeset="instance('items')/item"> <xf:label ref="." /> <xf:value ref="." /> </xf:itemset> </xf:select> <p> When trigger clicked, should it had deleted all nodes from select-list? <br /> Or it is ok for the selection-list to still contain the first-one node?? </p> <xf:trigger> <xf:label>xf:delete the contents of the xf:itemset's bound-document</xf:label> <xf:delete ev:event="DOMActivate" nodeset="instance('items')/*" /> </xf:trigger> </body> </html> |