Thread: [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 |
From: Alain C. <ala...@ag...> - 2013-09-07 19:44:00
|
Hello Eric, From my point of view, the incremental mode is the default one for select/select1 controls and, as a consequence, a rebuild can occur before the focus being lost. I have checked the event sequence with test 4.6.3.a and it is passed (I had first to fix an issue about inserting a non relevant node resulting in a new relevant node... I have committed another build for this fix). What do you think? -Alain Le 23/08/2013 15:38, Eric van der Vlist a écrit : > 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 > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: Eric v. d. V. <vd...@dy...> - 2013-09-07 19:50:59
|
Alain, Le samedi 07 septembre 2013 à 21:43 +0200, Alain Couthures a écrit : > Hello Eric, > > From my point of view, the incremental mode is the default one for > select/select1 controls and, as a consequence, a rebuild can occur > before the focus being lost. Yes, that's also the default for Orbeon Forms and it seems much more natural that way. Unfortunately, my understanding of the recommendation is that this should not be the case... > I have checked the event sequence with test 4.6.3.a and it is passed (I > had first to fix an issue about inserting a non relevant node resulting > in a new relevant node... I have committed another build for this fix). > > What do you think? IMHO, that boils down to decide if you prefer to be conformant to the recommendation or do what seems natural ;) ... I tend to think that being conformant to the recommendation should win but that's a hard decision to take! Thanks, Eric > -Alain |
From: Alain C. <ala...@ag...> - 2013-09-08 19:39:35
|
Eric, >> From my point of view, the incremental mode is the default one for >> select/select1 controls and, as a consequence, a rebuild can occur >> before the focus being lost. > Yes, that's also the default for Orbeon Forms and it seems much more > natural that way. Unfortunately, my understanding of the recommendation > is that this should not be the case... > >> I have checked the event sequence with test 4.6.3.a and it is passed (I >> had first to fix an issue about inserting a non relevant node resulting >> in a new relevant node... I have committed another build for this fix). >> >> What do you think? > IMHO, that boils down to decide if you prefer to be conformant to the > recommendation or do what seems natural ;) ... > > I tend to think that being conformant to the recommendation should win > but that's a hard decision to take! Sorry, could you please be more explicit about for which part of the recommendation Orbeon Forms and XSLTForms are not compliant? From my point of view, incremental="true" "*is the default for the select or select1 elements*" as mentioned at: 4.6.3 For |select| or |select1| Controls * When a selection is interactively changed, and the form control has the |incremental="true"| setting (*which is the default for the **|select|**or **|select1|**elements*), the event sequence is described at *4.6.6 Sequence: Selection Without Value Change* <http://www.w3.org/TR/xforms/#rpm-event-seq-swovc>, which may be followed immediately by the sequence described at *4.6.7 Sequence: Value Change* <http://www.w3.org/TR/xforms/#rpm-event-seq-vc>. Thanks! -Alain |
From: Eric v. d. V. <vd...@dy...> - 2013-09-09 13:45:21
|
Alain, You're 100% right, how can I have understood the opposite when that's so clearly written? I need more sleep (or more coffee), sorry for the noise... Thanks, Eric PS: Now I need to fill a bug for betterFORM! Le dimanche 08 septembre 2013 à 21:26 +0200, Alain Couthures a écrit : > Eric, > > > From my point of view, the incremental mode is the default one for > > > select/select1 controls and, as a consequence, a rebuild can occur > > > before the focus being lost. > > Yes, that's also the default for Orbeon Forms and it seems much more > > natural that way. Unfortunately, my understanding of the recommendation > > is that this should not be the case... > > > > > I have checked the event sequence with test 4.6.3.a and it is passed (I > > > had first to fix an issue about inserting a non relevant node resulting > > > in a new relevant node... I have committed another build for this fix). > > > > > > What do you think? > > IMHO, that boils down to decide if you prefer to be conformant to the > > recommendation or do what seems natural ;) ... > > > > I tend to think that being conformant to the recommendation should win > > but that's a hard decision to take! > Sorry, could you please be more explicit about for which part of the > recommendation Orbeon Forms and XSLTForms are not compliant? > > From my point of view, incremental="true" "is the default for the > select or select1 elements" as mentioned at: > > 4.6.3 For select or select1 Controls > * When a selection is interactively changed, and the form > control has the incremental="true" setting (which is the > default for the select or select1 elements), the event > sequence is described at 4.6.6 Sequence: Selection Without > Value Change, which may be followed immediately by the > sequence described at 4.6.7 Sequence: Value Change. > > Thanks! > > -Alain |