[Xsltforms-support] xf:reset does not restore xf:itemset items modified by xf:submission
Brought to you by:
alain-couthures
From: Kostis A. <ank...@gm...> - 2010-03-30 14:40:49
|
Hi, Reseting a model does not restore a modified-by-submission xf:itemsets. Reset indeed works when itemset was modified by an xf:delete (xf:insert??) action. Reported against rev372, Chrome, Firefox. The following files demonstrate the problem. XForms file ---------------- <?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>Restore xf:itemsets on xf:reset</title> <xf:model id="model-main" > <xf:instance id="inst-main"> <main> <data >1</data> </main> </xf:instance> <xf:instance id="inst-items" > <items> <item>1</item> <item>2</item> <item>3</item> </items> </xf:instance> <xf:bind id="bind-data" nodeset="/main/data" /> <xf:submission id="sub-fetch-items" resource="items.xml" method="GET" replace="instance" instance="inst-items" > </xf:submission> </xf:model> </head> <body> <p>Data: <xf:output ref="/main/data"/> </p> <p>xf:itemset's bound-document contents: <xf:repeat nodeset="instance('inst-items')/item"> <xf:output ref="."/> </xf:repeat> </p> Select1(minimal): <xf:select1 ref="/main/data"> <xf:itemset nodeset="instance('inst-items')/item"> <xf:label ref="." /> <xf:value ref="." /> </xf:itemset> </xf:select1> Select1(full): <xf:select1 ref="/main/data" appearance="full"> <xf:itemset nodeset="instance('inst-items')/item"> <xf:label ref="." /> <xf:value ref="." /> </xf:itemset> </xf:select1> Select(minimal): <xf:select ref="/main/data"> <xf:itemset nodeset="instance('inst-items')/item"> <xf:label ref="." /> <xf:value ref="." /> </xf:itemset> </xf:select> <xf:trigger> <xf:label>Load items from file</xf:label> <xf:action ev:event="DOMActivate" > <xf:send submission="sub-fetch-items"/> </xf:action> </xf:trigger> <xf:trigger> <xf:label>Delete bound xf:itemset nodes</xf:label> <xf:action ev:event="DOMActivate" > <xf:delete nodeset="instance('inst-items')/*"/> </xf:action> </xf:trigger> <xf:trigger> <xf:label>Reset restores only xf:delete effects</xf:label> <xf:action ev:event="DOMActivate" > <xf:reset/> </xf:action> </xf:trigger> </body> </html> Items file ------------- <items> <item>3</item> </items> |