[Xsltforms-support] xf:select without @incremental="true" not working as specified in the recommend
Brought to you by:
alain-couthures
From: Eric v. d. V. <vd...@dy...> - 2013-08-23 13:38:37
|
Hi, If you try: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <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" xmlns=""> <data> <PersonGivenName></PersonGivenName> <show>control-1</show> </data> </xf:instance> <xf:instance id="controls" xmlns=""> <controls> <control-1>disabled</control-1> <control-2>disabled</control-2> </controls> </xf:instance> </xf:model> </head> <body> <xf:select ref="show" appearance="full"> <xf:label>Display: </xf:label> <xf:item> <xf:label>control-1</xf:label> <xf:value>control-1</xf:value> </xf:item> <xf:item> <xf:label>control-2</xf:label> <xf:value>control-2</xf:value> </xf:item> </xf:select> <br /> <xf:group ref="instance('controls')"> <xf:output ref="control-1"> <xf:label>control-1</xf:label> </xf:output> <xf:output ref="control-2"> <xf:label>control-2</xf:label> </xf:output> </xf:group> <br /> <xf:input ref="PersonGivenName[contains(../show, 'control-1')]"> <xf:label>control-1 :</xf:label> <xf:message ev:event="xforms-enabled">Coucou</xf:message> <xf:setvalue ev:event="xforms-enabled" ref="instance('controls')/control-1">enabled</xf:setvalue> <xf:setvalue ev:event="xforms-disabled" ref="instance('controls')/control-1">disabled</xf:setvalue> </xf:input> <br /> <xf:input ref="PersonGivenName[contains(../show, 'control-2')]"> <xf:label>control-2 :</xf:label> <xf:setvalue ev:event="xforms-enabled" ref="instance('controls')/control-2">enabled</xf:setvalue> <xf:setvalue ev:event="xforms-disabled" ref="instance('controls')/control-2">disabled</xf:setvalue> </xf:input> </body> </html> You'll see that the controls control-1 and control-2 are displayed/hidden immediately after the selection is changed, before the focus leaves the xf:select which is not what is described in the recommendation (http://www.w3.org/TR/xforms11/#sequence-for-select ) Thanks, Eric |