Hello Eric,

While improving event management in XSLTForms for this test case, I would like to know if you deliberately make it with an inconsistency:

            <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>

instead of

            <xf:instance id="instance" xmlns="">
                <data>
                    <PersonGivenName></PersonGivenName>
                    <show>control-1</show>
                </data>
            </xf:instance>
            <xf:instance id="controls" xmlns="">
                <controls>
                    <control-1>*_enabled_*</control-1>
                    <control-2>disabled</control-2>
                </controls>
            </xf:instance>

This inconsistency is clearly disturbing with XSLTForms because events are fired only after the form being ready.

What do you think?

Thanks!

-Alain

Le 23/08/2013 15:29, Eric van der Vlist a écrit :
Hi,

Title says it all ;) ...

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" instance is never updated (as it should).

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to