W3C home > Mailing lists > Public > www-forms@w3.org > December 2001

Questions on WD 20011207 Targeting id's by a toggle within a repeat

From: Mark Dimon <mark@dimon.freeserve.co.uk>
Date: Wed, 12 Dec 2001 00:20:30 -0000
Message-ID: <002f01c182a2$e24d15a0$194cfea9@marks>
To: <www-forms@w3.org>
Hi

I have some Questions about WD 20011207  regarding targeting id's by a
toggle within <xforms:repeat> , if we take the following :-

<xforms:model>
<xforms:instance>
    <repeat>
        <switch>
            <value1>value1</value1>
            <value2>value2</value2>
        </switch>
        <switch>
            <value1>value1</value1>
            <value2>value2</value2>
        </switch>
        <switch>
            <value1>value1</value1>
            <value2>value2</value2>
        </switch>
    </repeat>
</xforms:instance>
</xforms:model>

<xforms:repeat ref="repeat">
    <xforms:switch ref="switch">

        <xforms:case id="case1">
            <xforms:input ref="value1"/>
        </xforms:case>

        <xforms:case id="case2">
            <xforms:input ref="value2"/>
        </xforms:case>

    </xforms:switch>

</xforms:repeat>

<xforms:button>
    <xforms:caption>case1</xforms:caption>
    <xforms:toggle case="case1" />
</xforms:button>
<xforms:button>
    <xforms:caption>case2</xforms:caption>
    <xforms:toggle case="case2" />
</xforms:button>

[Q1] how are events targeted at id's handled in a repeat
now with the above I should have 3 input fields all showing value1 initially
, if I click the second button what happens in the repeat , do all 3 switch
to value2 simultaneously or only the currently selected one ?

[Q2] presumably in the case above , all of the instance data is submitted ,
the switch allows us to edit different parts of the instance data at
different times , however if the instance data is not specifically set up
would this still be the case or would just the values of the currently
selected case be submitted ?

[Q3] to follow on from the last question , how is it possible to use a
switch to on the one hand use as a 'paged' UI to allow editing of parts of
the instance data like a 'wizard' and on the other use it to provide
conditional instance data i.e. the instance data returned is only that
contained in the case selected by the switch ?

[Q4] if we have nested repeats , how is the cursor obtained by id ,

<xforms:repeat id="idrep1" ref="repeat1">
    <xforms:group>
    <xforms:repeat id="idrep2" ref="repeat2">
        <xforms:input ref="value1"/>
    </xforms:repeat>
    </xforms:group>
</xforms:repeat>
<xforms:button>
    <xforms:insert nodeset="repeat1" at="cursor('idrep2')"
position="after"/>
</xforms:button>

again is it the currently selected inner repeat that is targeted ? and to
target another UI section of the outer repeat would we have to change the
outer repeats cursor first or is there another way?

Regards and thanks in advance

    Mark.
Received on Tuesday, 11 December 2001 18:19:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:50 GMT