Hi!
I am playing around with the form builder's autocomplete from latest trunk. I am using the resource mode that seems to work very great! Nevertheless, there seems to be an issue with setting the value of the autocomplete field from an initial instance: When POSTing an initial instance, all fields except the autocomplete is filled with the initial data. Does somebody know any possible reason for this? Thank you! |
Administrator
|
Hi Lacco,
This is a tricky one with the autocomplete. It is a selection control, so each item has a label and value. The value is the one stored in the instance, and the label is what is displayed to users. The question is: how do you get the label from the value? If we have the full itemset (i.e. the autocomplete is in static mode), then the autocomplete can do this automatically. Otherwise, you'll have to write some code to figure out the label, and dispatch fr-set-label to the autocomplete. http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/autocomplete#TOC-Setting-the-content-of-the-text-fie To make this easier, maybe we should extend the autocomplete resource mode, so you configure it with another service that takes a value as a request parameter and returns the label. The the autocomplete could call that service automatically on form load to get the label for a value stored in the instance. Alex On Tue, Aug 16, 2011 at 6:06 AM, lacco <[hidden email]> wrote: > Hi! > > I am playing around with the form builder's autocomplete from latest trunk. > I am using the resource mode that seems to work very great! Nevertheless, > there seems to be an issue with setting the value of the autocomplete field > from an initial instance: When POSTing an initial instance, all fields > except the autocomplete is filled with the initial data. Does somebody know > any possible reason for this? > > Thank you! > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-builder-s-autocomplete-and-initial-instance-tp3747135p3747135.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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/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 |
Hi Alex,
I played around with the "Setting by label" alternative, but didn't come up with a final solution. I would like to add a small snippet to autocomplete.xbl component that takes the value and post it to the server to determine the label. I would like to get the following working: <xforms:dispatch ev:event="DOMActivate" targetid="my-autocomplete-control" name="fr-set-label"> <xxforms:context name="label" select="xxforms:bind('my-autocomplete-bind')"/> </xforms:dispatch> Should this snippet work as expected, where do I have to put it when editing the source code via form builder? How do I integrate it into autcomplete.xpl, how do I get targetid and the binding dynamically? Thank you! |
Administrator
|
Hi Lacco,
I don't see a way to support this by adding something that would be simple to the XBL. You could imagine adding something to your form. But for this, you would need to: 1. Implement a service that returns the label for a given value. 2. Add a <xforms:submission> pointing to that service. 3. Add instance(s) for the input/output to the service. 4. On xforms-model-construct-done or xforms-ready, call the service, and send the label to the autocomplete with fr-set-label. This all sounds rather complicated, and I think it would be better to implement this at the autocomplete level. I added a [LIMITATION] paragraph in the section pointed to by the link below, so we don't forget about all this: http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/autocomplete?pli=1#TOC-Resource Alex On Tue, Aug 30, 2011 at 1:58 AM, lacco <[hidden email]> wrote: > Hi Alex, > > I played around with the "Setting by label" alternative, but didn't come up > with a final solution. I would like to add a small snippet to > autocomplete.xbl component that takes the value and post it to the server to > determine the label. I would like to get the following working: > > <xforms:dispatch ev:event="DOMActivate" targetid="my-autocomplete-control" > name="fr-set-label"> > <xxforms:context name="label" > select="xxforms:bind('my-autocomplete-bind')"/> > </xforms:dispatch> > > Should this snippet work as expected, where do I have to put it when editing > the source code via form builder? How do I integrate it into > autcomplete.xpl, how do I get targetid and the binding dynamically? > > Thank you! > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-builder-s-autocomplete-and-initial-instance-tp3747135p3778267.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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/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 |
Thanks for your answer. So the new autocomplete xbl won't be helpful for me, I am going back to "conventional" select boxes with loading the data when the form loads. I would be glad to see such enhancements to the autocomplete xbl, thank you!
|
In reply to this post by Alessandro Vernet
Hi, I really need to work this out. I will try the suggestion you made here and on an older thread here : http://orbeon-forms-ops-users.24843.n4.nabble.com/Setting-content-of-text-field-in-fr-autocomplete-td2216656.html
If it works, I will try to implement it at XBL level. But I might need more help… Thanks! Vincent |
That would be really great, I am definitely interested! If I can help you with my very little Orbeon knowledge, leave a message!
|
Administrator
|
Vincent, Lacco,
This limitation has now been lifted. See: http://blog.orbeon.com/2012/03/autocomplete-gets-new-labelref.html This is implemented in nighty builds. Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Administrator
|
In reply to this post by lacco
Vincent, Lacco,
This limitation has now been lifted. See: http://blog.orbeon.com/2012/03/autocomplete-gets-new-labelref.html This is implemented in nighty builds. Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Thanks a bunch!
Vincent On 2012-03-19, at 2:57 PM, Alessandro Vernet [via Orbeon Forms (ops-users)] wrote: Vincent, Lacco, |
Free forum by Nabble | Edit this page |