[Xsltforms-support] xf:recalculate not working as expected
Brought to you by:
alain-couthures
From: Eric v. d. V. <vd...@dy...> - 2013-08-20 16:56:44
|
Hi, With Orbeon Forms and betterFORM the xf:recalculate action causes an immediate recalculation of calculated values in instances and this is very useful when you have to update an instance and check or copy calculated values in a single action. With XSLTForms the xf:recalculation appears to be deferred and the calculated values are not immediatly updated :( ... A simple repro is: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Hello World in XForms</title> <xf:model id="model"> <xf:instance id="instance"> <data xmlns=""> <source>foo</source> <calculated></calculated> <copied></copied> </data> </xf:instance> <xf:bind nodeset="/data/calculated" calculate="../source"></xf:bind> <xf:action ev:event="xforms-ready"> <xf:setvalue ref="/data/source">bar</xf:setvalue> <xf:recalculate></xf:recalculate> <xf:setvalue ref="/data/copied" value="../calculated"></xf:setvalue> </xf:action> </xf:model> </head> <body> <xf:output ref="source"> <xf:label>Source: </xf:label> </xf:output> <br /> <xf:output ref="calculated"> <xf:label>Calculated:</xf:label> </xf:output> <br /> <xf:output ref="copied"> <xf:label>Copied: </xf:label> </xf:output> </body> </html> XSLTForms displays: Source: bar Calculated:bar Copied: foo while of course, all 3 values should be "bar". Thanks, Eric Eric |