Issue with autocomplete on orbeon 4.1

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

Issue with autocomplete on orbeon 4.1

ricetrac

Hello,

 

I’m trying to migrate from ORBEON 3.8 to ORBEON 4.1.

We don’t use Form Builder, but only xforms engine.

 

We have a page with two <fr:autocomplete> with dynamic-itemset="true". So, we use a « setting by label » to initialize the field on the « xforms-ready » event :

<xf:action ev:event="xforms-ready">

            <xf:dispatch target="code1" name="fr-set-label">

                  <xxf:context name="label" select="/form/demandeConnexion/compteExtranet/moAdresse/msCodePostale"/>

            </xf:dispatch>

            <xf:dispatch target="ville1" name="fr-set-label">

                  <xxf:context name="label" select="/form/demandeConnexion/compteExtranet/moAdresse/msVille"/>

            </xf:dispatch>

</xf:action>

 

 

But, sometimes the two fields are non-relevant, and with Orbeon 4.1 (not with 3.8), I then an error :

Reference to non-existing model id: autocomplete-model »

 

On :

oxf:/xbl/orbeon/autocomplete/autocomplete.xbl

Line 85

 

If I comment these line (dispatch “fr-set-label”), I don’t have any more the error.

 

Can you help me ?

 

Thank You.

 

Julien

 

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Issue with autocomplete on orbeon 4.1

Alessandro  Vernet
Administrator
Hi Julien,

The error message you're getting isn't the most telling, but non-relevant controls are not "fully alive", hence dispatching events to those controls is looking for trouble. (Most likely the situation should be clearer, and events dispatched to non-relevant controls should just be ignored, and maybe generate a warning message in the logs.)

Instead of dispatching fr-set-label on xforms-ready, could you dispatch it when the autocomplete gets an xforms-enabled? (If the autocomplete becomes relevant, non-relevant, and then relevant again, then doing this only the first time it becomes relevant.)

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Issue with autocomplete on orbeon 4.1

ricetrac
Hi,

Thank You for your response.
I try this and it's ok :
<xf:action ev:event="xforms-enabled" ev:observer="code1 ville1">
     <xf:dispatch target="code1" name="fr-set-label">
        <xxf:context name="label" select="/form/demandeConnexion/compteExtranet/moAdresse/msCodePostale"/>
     </xf:dispatch>
                               
     <xf:dispatch target="ville1" name="fr-set-label">
        <xxf:context name="label" select="/form/demandeConnexion/compteExtranet/moAdresse/msVille"/>
     </xf:dispatch>
</xf:action>

But how to know this is the first time it becomes relevant ?

Thank You.

Julien
Reply | Threaded
Open this post in threaded view
|

Re: Issue with autocomplete on orbeon 4.1

Alessandro  Vernet
Administrator
Hi Julien,

Is it OK to set the label the following times it becomes relevant (even if not necessary)? Because if it is, you might just do it, even the following times just to simplify things. Otherwise, you'll need to store somehow, somewhere, the id of the control on which you set the value. In the event handler, you can use event('xxforms:absolute-targetid') to get the id of the autocomplete that became relevant.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Issue with autocomplete on orbeon 4.1

ricetrac
ok, I do not actually really need to check this out, because the component is either present or not present when the page is loaded. It is not masked during the filling thereof.

Thank You.

Julien
Reply | Threaded
Open this post in threaded view
|

Re: Issue with autocomplete on orbeon 4.1

Alessandro  Vernet
Administrator
Julien,

Okay, then this is a simple one :).

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet