fr-set-label for fr:autocomplete in an XBL component

Posted by Ethan Gruber on
URL: https://discuss.orbeon.com/fr-set-label-for-fr-autocomplete-in-an-XBL-component-tp2916972.html

I'm finally getting around to doing the smart thing and moving my autocomplete controls into XBL components to better facilitate repeatability within my form.  The transition is nearly complete (the dynamic itemset is populated based on queries that the user types into the fr:autocomplete text input), but I haven't quite figured out how to set the label of the XBL component when the document reloads in the form.

Before the change to XBL, the code to set the labels looked something like this:

<xforms:action ev:event="xforms-ready">
  <xforms:action xxforms:iterate="//subject">
    <xxforms:variable name="name" select="name()"/>
    <xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
    <xforms:dispatch target="{concat($name, '-autocomplete-control')}" name="fr-set-label">
      <xxforms:context name="label" select="normalize-space(context())"/>
    </xforms:dispatch>
  </xforms:action>
</xforms:action>

This action is defined in the model for my form.  It doesn't successfully set the label of the fr:autocomplete contained in XBL.

In my test form, I am calling the new component with this:

<xforms:repeat nodeset="subject" id="subject-repeat">
  <eaditor:subject-autocomplete ref="."/>
</xforms:repeat>

Attached is the XBL component.  It contains a model, but it seems that <xforms:action ev:event="xforms-ready"> does not work in that model.  Since the above xforms:action does not set the label of the component when embedded into the model in my test form, I'm not quite sure where the problem lies or potential workarounds.

Help would be greatly appreciated,
Ethan


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws

subject-autocomplete.xbl (10K) Download Attachment