On Fri, Oct 1, 2010 at 1:06 PM, Ethan Gruber <
[hidden email]> wrote:
> As a followup, I noticed that xforms-ready isn't supported in local XBL
> models, so I switched to using xforms-model-construct-done. I can write a
> test value to a test instance, but I'm not sure how to access the value of
> the fr:autocomplete bound by $binding from within the local model.
>
> I wanted to try testing setting the label with a test value in the mean
> time. The following is in the local model for my XBL component:
>
> <xforms:action ev:event="xforms-model-construct-done">
> <xforms:dispatch target="subject-autocomplete-control"
> name="fr-set-label">
> <xxforms:context name="label" select="'test'"/>
> </xforms:dispatch>
> </xforms:action>
>
> It has no effect on setting the label. I'm kind of lost. I'm sure it is
> theoretically possible to set the label for each fr:autocomplete on
> xforms-model-contruct-done, but I'm not entirely sure of the syntax.
>
> Thanks for the help,
> Ethan
>
> On Fri, Oct 1, 2010 at 10:49 AM, Ethan Gruber <
[hidden email]> wrote:
>>
>> 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
>
>
>