W3C home > Mailing lists > Public > public-xformsusers@w3.org > November 2018

ACTION-2197 - Send example of idref identification

From: Erik Bruchez <erik@bruchez.org>
Date: Tue, 13 Nov 2018 21:58:50 -0800
Message-ID: <CAAc0PEXJi6XSbPS5zJiJYXnmoiK3XwnmOFxgd6NvtYVASL3Uuw@mail.gmail.com>
To: XForms <public-xformsusers@w3.org>
All,

Following Steven's ACTION-2193 [1].

Let's consider the following repeat:

    <repeat ref="outer-iteration" id="outer-repeat">
        <input ref="outer-input" id="outer-input"/>
        <repeat ref="inner-iteration" id="inner-repeat">
            <input  ref="inner-input"  id="inner-input">
                <setfocus
                    event="xforms-value-changed"
                    control="inner-textarea"/>
            </input>
            <output ref="inner-textarea" id="inner-textarea"/>
        </repeat>
    </repeat>

And the following data:

    <data>
        <outer-iteration>
            <outer-input>o1</outer-input>
            <inner-iteration>
                <inner-input>o1i1</inner-input>
                <inner-textarea/>
            </inner-iteration>
            <inner-iteration>
                <inner-input>o1i2</inner-input>
                <inner-textarea/>
            </inner-iteration>
        </outer-iteration>
        <outer-iteration>
            <outer-input>o2</outer-input>
            <inner-iteration>
                <inner-input>o2i1</inner-input>
                <inner-textarea/>
            </inner-iteration>
            <inner-iteration>
                <inner-input>o2i2</inner-input>
                <inner-textarea/>
            </inner-iteration>
            <inner-iteration>
                <inner-input>o2i3</inner-input>
                <inner-textarea/>
            </inner-iteration>
        </outer-iteration>
    </data>

Now let's say that:

- The current index of `outer-repeat` is 1
- The current index of `inner-repeat` is 1
- By means of as separate `setvalue`, the value `o2i3` changes.

What should happen then? The event handler for `inner-input` at position
(2, 3) runs. That means the control in the second iteration of
`outer-repeat` and then the third iteration of the nested `inner-repeat`.

My understanding is that with XForms 1.1, [2] the `setfocus` targets the
`inner-textarea` at position (2, 3) as well. That is, the "closest"
control, as it is "in the same set of run-time objects that contains the
source object". This is how our implementation interprets the id resolution
too.

Now in this case, that control is *not* in any current repeat index. So
with Steven's proposed change, the `control` id reference would not reach
it, because it would only reach objects which are currently in the set of
controls selected by the repeat indexes, in this case (1, 1).

If the above is correct, it would follow that the proposed wording change
is not equivalent to the XForms 1.1 behavior. In which case, I would prefer
we keep the XForms 1.1 behavior.

-Erik

[1] https://lists.w3.org/Archives/Public/public-xformsusers/2018Aug/0029
[2] https://www.w3.org/TR/xforms11/#idref-resolve-repeat
Received on Wednesday, 14 November 2018 05:59:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 14 November 2018 05:59:25 UTC