nested setvalue in repeat

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

nested setvalue in repeat

Mark Waschkowski
Hi,

Basically this is about context within a repeat, and how setvalue
doesn't respect the context, but other xforms elements do. I'm
actually not sure about which elements respect the repeat context, and
which that don't, and this is part of the darn problem!

It seems very odd to me that I can do:

<xf:repeat model="contacts" nodeset="/node/node" id='contacts-repeat'>
   <xf:output ref="property[@name='email']/value"/>
</xf:repeat>

but I can't do:

<xf:repeat model="contacts" nodeset="/node/node" id='contacts-repeat'>
   <xf:action ev:event="DOMActivate">
      <xf:setvalue model="contacts" ref="instance('contact-instance')/
uuid"
         value="instance('contacts-instance')/
            property[@name='email']/value"/>
      <xf:toggle case="displayContact"/>
   </xf:action>
</xf:repeat>

Please note the attempted (and non-functioning) use of a repeat
contextual reference 'property[@name='email']/value' in both the
xf:output and xf:setvalue elements.

That I'm forced to do it this way:

<xf:repeat model="contacts" nodeset="/node/node" id='contacts-repeat'>
   <xf:action ev:event="DOMActivate">
      <xf:setvalue model="contacts"
        ref="instance('contact-instance')/uuid"
        value="instance('contacts-instance')/node[index('contacts-
repeat')]/
           property[@name='email']/value"/>
      <xf:toggle case="displayContact"/>
   </xf:action>
</xf:repeat>

kinda makes me want to pull my hair out.

How do other people feel about this?

Thanks,

Mark

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms