using xforms:repeat with binds instead of nodeset/ref

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using xforms:repeat with binds instead of nodeset/ref

Adrian Baker-2
OPS seems to have a problem when I specify a bind on a repeat and binds
on the child repeating controls, instead of a nodeset on the repeat and
refs on the child repeating controls. I get the correct number of
repeats, but it's just the first item repeated n times.

eg

<data>
   <item>
      <value>apple</value>
   </item>
   <item>
      <value>orange</value>
   </item>
   <item>
      <value>pear</value>
   </item>
</data>

<xforms:bind id="items" nodeset="data/item">
   <xforms:bind id="value" nodeset="value"/>
</xforms:bind>

<xforms:repeat bind="items">
   <xforms:input bind="value" .../>
</xforms:repeat>

So here I'd get apple+apple+apple instead of apple+orange+pear. Changing
the repeat and the child controls to refer to the data directly using
nodeset + ref corrects the problem.

I assume this is valid markup since it worked ok under Chiba.. ?

Attached is an example demonstrating the problem.

Adrian

Form Administration
65543 TestName 113390137502834 TestDescription 113390137502834 0 false false false false 6 2326536 Test facet113635898390711 0 3 0 2785301 value1 0 2785309 value2 0 2326972 Test facet113635910547913 4 -1 0 2785307 test value 111364130965371 0 2785288 test value 011364130965371 0 2785285 test value 211364130965371 0 2785292 test value 311364130965371 0 {template facet} 0 -1
131079 1 2005-12-07T09:36:15+13:00 2005-12-07T09:36:15+13:00 user1 1
2005-12-07T09:36:16+13:00 currentUser 131080 2 2005-12-07T09:36:15+13:00 2005-12-07T09:36:16+13:00 user2 1 131081 3 2005-12-07T09:36:16+13:00 anEditingUser 2005-12-07T09:36:16+13:00 0 131082 4 2005-12-07T09:36:16+13:00 currentUser 2005-12-07T09:36:16.333+13:00 0 131082 5 2005-12-07T09:36:16.333+13:00 0 test 2326536 Test facet113635898390711 0 3 0 2326972 Test facet113635910547913 4 -1 0 newone2 Optional Facet2 0 -1 0 currentUser view true <xhtml:body onResize="resizeHandler();" onload="init();"> Form Administration (Processing ) Save Save Amend Cancel Cancel
Reply | Threaded
Open this post in threaded view
|

Re: using xforms:repeat with binds instead of nodeset/ref

Erik Bruchez
Administrator
Adrian,

The behavior of binding to an inner bind id (in your case, the "value"
bind) is not clearly specified by the spec. This issue is currently
discussed within the XForms Working Group.

Some engines apply the "first node rule" (i.e. your bind returns always
the first <value> element). Some try to look at the current repeat
iteration to make a choice (which is clearly not specified by the spec).
OPS does the former.

The bottom line is that currently, you should not do that unless the
outer bind returns only one element, and use nodeset / ref instead.

-Erik

Adrian Baker wrote:

> OPS seems to have a problem when I specify a bind on a repeat and binds
> on the child repeating controls, instead of a nodeset on the repeat and
> refs on the child repeating controls. I get the correct number of
> repeats, but it's just the first item repeated n times.
>
> eg
>
> <data>
>   <item>
>      <value>apple</value>
>   </item>
>   <item>
>      <value>orange</value>
>   </item>
>   <item>
>      <value>pear</value>
>   </item>
> </data>
>
> <xforms:bind id="items" nodeset="data/item">
>   <xforms:bind id="value" nodeset="value"/>
> </xforms:bind>
>
> <xforms:repeat bind="items">
>   <xforms:input bind="value" .../>
> </xforms:repeat>
>
> So here I'd get apple+apple+apple instead of apple+orange+pear. Changing
> the repeat and the child controls to refer to the data directly using
> nodeset + ref corrects the problem.
>
> I assume this is valid markup since it worked ok under Chiba.. ?
>
> Attached is an example demonstrating the problem.
>
> Adrian
>
> ------------------------------------------------------------------------
>
> Form Administration
> 65543 TestName 113390137502834 TestDescription 113390137502834 0 false
> false false false 6 2326536 Test facet113635898390711 0 3 0 2785301
> value1 0 2785309 value2 0 2326972 Test facet113635910547913 4 -1 0
> 2785307 test value 111364130965371 0 2785288 test value 011364130965371
> 0 2785285 test value 211364130965371 0 2785292 test value
> 311364130965371 0 {template facet} 0 -1
>
> 131079 1 2005-12-07T09:36:15+13:00 2005-12-07T09:36:15+13:00 user1 1
> 2005-12-07T09:36:16+13:00 currentUser 131080 2 2005-12-07T09:36:15+13:00
> 2005-12-07T09:36:16+13:00 user2 1 131081 3 2005-12-07T09:36:16+13:00
> anEditingUser 2005-12-07T09:36:16+13:00 0 131082 4
> 2005-12-07T09:36:16+13:00 currentUser 2005-12-07T09:36:16.333+13:00 0
> 131082 5 2005-12-07T09:36:16.333+13:00 0 test 2326536 Test
> facet113635898390711 0 3 0 2326972 Test facet113635910547913 4 -1 0
> newone2 Optional Facet2 0 -1 0 currentUser view true Form Administration
> (Processing ) Save Save Amend Cancel Cancel Form Administration
> (Processing ) Form Administration Form Detail Form Name Template form
> Yes true No false Description Information Model Is part of clinical
> record Yes true No false Supports draft workflow Yes true No false
> Contact Form Facets This facet has an invalid number of values Add
> another value for this facet Add additional facet Form Editions Publish
> Create a new edition Form Detail Form Name Template form Yes true No
> false Description Information Model Is part of clinical record Yes true
> No false Supports draft workflow Yes true No false Contact Form Facets
> This facet has an invalid number of values Add another value for this
> facet Add additional facet Form Editions Publish Create a new edition
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws