fr:autocomplete with resource mode

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

fr:autocomplete with resource mode

s.valkova
Hi,
I'm using fr:autocomplete in table so I have to use it with resource mode, but I have a problem with this xbl component. I see that for every autocomplete I have a model and instances in it that have been generated, for example for autocomplete with id = dynamicProjectId I have
<model id="dynamicProjectId$autocomplete-model·1">
        <instance id="dynamicProjectId$local·1"/>
        <instance id="dynamicProjectId$suggestions-instance·1"/>
</model>
The resource attribute points to an HTTP service responding with an XML document. And on event xforms-value-changed I want to take a value from this xml (instance dynamicProjectId$suggestions-instance·1). I try with xxforms:instance('dynamicProjectId$suggestions-instance·1'), but with no success. I set on itemset key and value and work correct but in returned XML I have other nodes with values that I have to take.
For example :
How can I get values from this instance on value changed event, not in xforms:itemset? Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: fr:autocomplete with resource mode

Alessandro  Vernet
Administrator
Hi Sonia,

I guess you saw those instances (e.g.
dynamicProjectId$suggestions-instance·1) using the XForms Inspector.
You are not supposed to be able to access those instance, as they are
private to the XBL component. Are you saying that there are other
values returned by the service that are useful beyond the scope of the
autocomplete and its itemset? If that is the case, maybe you should
use the "dynamic" instead of "resource" mode, so you are the one
making the call to the service, and have fully access to what is
returned by the service. Or am I missing something?

Alex

On Wed, Jan 18, 2012 at 12:43 AM, s.valkova <[hidden email]> wrote:

> Hi,
> I'm using fr:autocomplete in table so I have to use it with resource mode,
> but I have a problem with this xbl component. I see that for every
> autocomplete I have a model and instances in it that have been generated,
> for example for autocomplete with id = dynamicProjectId I have
> <model id="dynamicProjectId$autocomplete-model·1">
>        <instance id="dynamicProjectId$local·1"/>
>        <instance id="dynamicProjectId$suggestions-instance·1"/>
> </model>
> The resource attribute points to an HTTP service responding with an XML
> document. And on event xforms-value-changed I want to take a value from this
> xml (instance dynamicProjectId$suggestions-instance·1). I try with
> xxforms:instance('dynamicProjectId$suggestions-instance·1'), but with no
> success. I set on itemset key and value and work correct but in returned XML
> I have other nodes with values that I have to take.
> For example :
> How can I get values from this instance on value changed event, not in
> xforms:itemset? Thanks!
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/fr-autocomplete-with-resource-mode-tp4306038p4306038.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
>


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


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: fr:autocomplete with resource mode

s.valkova
Hi,
Thanks for the answer, but if I use "dynamic" mode in table I have many fields that point to one instance and if I have 3 lines( for every row I have one fr:autocomplete with value)  for example in the table and put value for all autocomplet. If I click on the first line autocomplete field suggest me to pick the last value that is in the instance that pointed. Than try to validate the value and if you click some where on the form, the value from autocomplete is removed. I think that happened because of shearing one instance for all fields (for example account field ) on the table. So I made the following changes - in fr:autocomplete I check for event DOMFocusIn and if there is a value dispatch the label to change the value in the instance. Is there another solution or this is correct ? Many thanks
Sonya
Reply | Threaded
Open this post in threaded view
|

Re: Re: fr:autocomplete with resource mode

Alessandro  Vernet
Administrator
Hi Sonya,

I don't fully understand the solution you implemented; if it works for
you then I guess you're good :). I think I would have kept the
suggestion list for each autocomplete separate, maybe using an
instance that looks like:

<suggestion-list>
        <suggestions>...</suggestions>
        <suggestions>...</suggestions>
        <suggestions>...</suggestions>
</suggestion-list>

Where each <suggestions> contains the suggestions for one
autocomplete. Of course, this creates some additional complexity, as
you need to make sure you have enough <suggestions> "containers", so
you might need to create them dynamically when you load the data, and
add them when rows are added to the table.

Alex

On Fri, Feb 3, 2012 at 7:08 AM, s.valkova <[hidden email]> wrote:

> Hi,
> Thanks for the answer, but if I use "dynamic" mode in table I have many
> fields that point to one instance and if I have 3 lines( for every row I
> have one fr:autocomplete with value)  for example in the table and put value
> for all autocomplet. If I click on the first line autocomplete field suggest
> me to pick the last value that is in the instance that pointed. Than try to
> validate the value and if you click some where on the form, the value from
> autocomplete is removed. I think that happened because of shearing one
> instance for all fields (for example account field ) on the table. So I made
> the following changes - in fr:autocomplete I check for event DOMFocusIn and
> if there is a value dispatch the label to change the value in the instance.
> Is there another solution or this is correct ? Many thanks
> Sonya
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/fr-autocomplete-with-resource-mode-tp4306038p4354835.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
>


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


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet