autosuggest/autocomplete in Orbeon

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

autosuggest/autocomplete in Orbeon

Ethan Gruber
I'm wondering if anyone has integrated autosuggest/autocomplete into their xforms apps, particularly anything related to terms from a solr index (via TermComponent perhaps)?

Ethan Gruber
University of Virginia Library


--
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
Reply | Threaded
Open this post in threaded view
|

Re: autosuggest/autocomplete in Orbeon

Alessandro Vernet
Administrator
Ethan,

Ethan Gruber wrote
I'm wondering if anyone has integrated autosuggest/autocomplete into their
xforms apps, particularly anything related to terms from a solr index (via
TermComponent perhaps)?
Yes, we do use the autocomplete field in a number of situations. I recommend you use the XBL <fr:autocomplete> component for this. You can find more on this on the wiki at:

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-existing-xbl-components#TOC-Autocomplete

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: autosuggest/autocomplete in Orbeon

Ethan Gruber
Hi Alessandro,

That makes sense.  I need a dynamic autoset.  My further question is how do I define "instance('instance-dynamic')" if it is coming from a different tomcat application (like solr)?  What should the information within 'instance-dynamic' look like?  Solr returns XML, but can I point the instance to a url and a node within that url, like the document() function in XSLT?  Example:

document('localhost:8080/solr/select?q=this', //lst[@name=state_facet])

Thanks,
Ethan


On Mon, Aug 10, 2009 at 5:29 AM, Alessandro Vernet <[hidden email]> wrote:

Ethan,


Ethan Gruber wrote:
>
> I'm wondering if anyone has integrated autosuggest/autocomplete into their
> xforms apps, particularly anything related to terms from a solr index (via
> TermComponent perhaps)?
>

Yes, we do use the autocomplete field in a number of situations. I recommend
you use the XBL <fr:autocomplete> component for this. You can find more on
this on the wiki at:

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-existing-xbl-components#TOC-Autocomplete

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/autosuggest-autocomplete-in-Orbeon-tp24883957p24896777.html
Sent from the ObjectWeb 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




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: autosuggest/autocomplete in Orbeon

Alessandro Vernet
Administrator
Ethan,

Ethan Gruber wrote
That makes sense.  I need a dynamic autoset.  My further question is how do
I define "instance('instance-dynamic')" if it is coming from a different
tomcat application (like solr)?  What should the information within
'instance-dynamic' look like?  Solr returns XML, but can I point the
instance to a url and a node within that url, like the document() function
in XSLT?  Example:

document('localhost:8080/solr/select?q=this', //lst[@name=state_facet])
You can get the data with an <xforms:submission>. That submission populates an instance, and the <xforms:itemset> points to that instance. Then if you need to refresh that list as the user types, you can use the "dynamic itemset" mode. You can find an example of this in the XForms controls example. In the second tab there is a field using an fr:autocomplete for you to enter a country name which is pulled down from a service.

Alex
Reply | Threaded
Open this post in threaded view
|

autocomplete only showing one value

Chris Fitzpatrick

Hello,

I'm trying to use the fr:autocomplete function to work on a xquery  
service I made, but I can only get the itemset box to display the  
first element of the returned results.
Here's an exmaple:

<fr:autocomplete ref="instance('suggest-query')" id="country-name-
dynamic"
                                                                 incremental="true" dynamic-itemset="true" max-
results-displayed="20"
                                                                 style="width: 15em;">
                                                    <xforms:label>Enter a country name: </xforms:label>
                                                    <xforms:itemset nodeset="instance('suggestions')/suggestions">
                                                                                <xforms:label ref="suggestion/*"/>
                                                                                <xforms:value ref="suggestion/*"/>
                                                                            </xforms:itemset>
                                                    <xforms:send submission="suggest" ev:event="xforms-value-
changed"/>
                                                </fr:autocomplete>

Here an example suggestion instance:
<toplevel><suggestions>
                <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
" xmlns="info:lc/xmlns/codelist-v1">Fox</name></suggestion>
                <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
" xmlns="info:lc/xmlns/codelist-v1">Fon</name></suggestion>
                <suggestion><name xmlns:xsi="http://www.w3.org/2001/XMLSchema- 
instance" xmlns="info:lc/xmlns/codelist-v1">Foulse</name></suggestion>
                <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
" xmlns="info:lc/xmlns/codelist-v1">Folopa</name></suggestion>
                <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
" xmlns="info:lc/xmlns/codelist-v1">Fore</name></suggestion>
</suggestions></toplevel>


In these example, only the "Fox" value shows up in the itemset box.  
Looking at the DOM, it seems like there are some <li> that are both  
empty and have display:none as the style.

Any suggestions?

Thanks, chris.


On Aug 10, 2009, at 2:03 PM, Alessandro Vernet wrote:

>
> Ethan,
>
>
> Ethan Gruber wrote:
>>
>> That makes sense.  I need a dynamic autoset.  My further question  
>> is how
>> do
>> I define "instance('instance-dynamic')" if it is coming from a  
>> different
>> tomcat application (like solr)?  What should the information within
>> 'instance-dynamic' look like?  Solr returns XML, but can I point the
>> instance to a url and a node within that url, like the document()  
>> function
>> in XSLT?  Example:
>>
>> document('localhost:8080/solr/select?q=this', //
>> lst[@name=state_facet])
>>
>
> You can get the data with an <xforms:submission>. That submission  
> populates
> an instance, and the <xforms:itemset> points to that instance. Then  
> if you
> need to refresh that list as the user types, you can use the "dynamic
> itemset" mode. You can find an example of this in the XForms controls
> example. In the second tab there is a field using an fr:autocomplete  
> for you
> to enter a country name which is pulled down from a service.
>
> Alex
>
> -----
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
> Twitter - http://twitter.com/avernet
> --
> View this message in context: http://www.nabble.com/autosuggest-autocomplete-in-Orbeon-tp24883957p24907455.html
> Sent from the ObjectWeb 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


--
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
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete only showing one value

Chris Fitzpatrick

Oops.

Nevermind.

I just reread my email and realized what I was doing wrong. Corrected  
below:

<xforms:itemset nodeset="instance('suggestions')/suggestions/
suggestion">
                                                                                <xforms:label ref="./*"/>
                                                                                <xforms:value ref="./*"/>
                                                                            </xforms:itemset>

Sorry!
best,chris.



On Sep 8, 2009, at 1:39 PM, Chris Fitzpatrick wrote:

>
> Hello,
>
> I'm trying to use the fr:autocomplete function to work on a xquery  
> service I made, but I can only get the itemset box to display the  
> first element of the returned results.
> Here's an exmaple:
>
> <fr:autocomplete ref="instance('suggest-query')" id="country-name-
> dynamic"
>                 incremental="true" dynamic-itemset="true" max-
> results-displayed="20"
>                 style="width: 15em;">
>    <xforms:label>Enter a country name: </xforms:label>
>    <xforms:itemset nodeset="instance('suggestions')/
> suggestions">
>                        <xforms:label ref="suggestion/*"/>
>                        <xforms:value ref="suggestion/*"/>
>                    </xforms:itemset>
>    <xforms:send submission="suggest" ev:event="xforms-value-
> changed"/>
> </fr:autocomplete>
>
> Here an example suggestion instance:
> <toplevel><suggestions>
> <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> " xmlns="info:lc/xmlns/codelist-v1">Fox</name></suggestion>
> <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> " xmlns="info:lc/xmlns/codelist-v1">Fon</name></suggestion>
> <suggestion><name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> " xmlns="info:lc/xmlns/codelist-v1">Foulse</name></suggestion>
> <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> " xmlns="info:lc/xmlns/codelist-v1">Folopa</name></suggestion>
> <suggestion><name authorized="yes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> " xmlns="info:lc/xmlns/codelist-v1">Fore</name></suggestion>
> </suggestions></toplevel>
>
>
> In these example, only the "Fox" value shows up in the itemset box.  
> Looking at the DOM, it seems like there are some <li> that are both  
> empty and have display:none as the style.
>
> Any suggestions?
>
> Thanks, chris.
>
>
> On Aug 10, 2009, at 2:03 PM, Alessandro Vernet wrote:
>
>>
>> Ethan,
>>
>>
>> Ethan Gruber wrote:
>>>
>>> That makes sense.  I need a dynamic autoset.  My further question  
>>> is how
>>> do
>>> I define "instance('instance-dynamic')" if it is coming from a  
>>> different
>>> tomcat application (like solr)?  What should the information within
>>> 'instance-dynamic' look like?  Solr returns XML, but can I point the
>>> instance to a url and a node within that url, like the document()  
>>> function
>>> in XSLT?  Example:
>>>
>>> document('localhost:8080/solr/select?q=this', //
>>> lst[@name=state_facet])
>>>
>>
>> You can get the data with an <xforms:submission>. That submission  
>> populates
>> an instance, and the <xforms:itemset> points to that instance. Then  
>> if you
>> need to refresh that list as the user types, you can use the "dynamic
>> itemset" mode. You can find an example of this in the XForms controls
>> example. In the second tab there is a field using an  
>> fr:autocomplete for you
>> to enter a country name which is pulled down from a service.
>>
>> Alex
>>
>> -----
>> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
>> Orbeon's Blog: http://www.orbeon.com/blog/
>> Personal Blog: http://avernet.blogspot.com/
>> Twitter - http://twitter.com/avernet
>> --
>> View this message in context: http://www.nabble.com/autosuggest-autocomplete-in-Orbeon-tp24883957p24907455.html
>> Sent from the ObjectWeb 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
>
>
> --
> 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


--
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