Auto complete bug

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

Auto complete bug

David Sinclair
Hi,

I think there is a bug with the autocomplete mechanism for select1.  
Basically it seems that the id is being used instead of the label.   The
xform at the bottom of this shows the problem in the sandbox.

In one of our apps we use the autocomplete where some labels have spaces
in them and others do not.  In this case it allows you to select labels
that do not have spaces, but those that have spaces the id is used.  I
have not been able to reproduce this in a simple example though...

Dave

<html xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
      xmlns:f="http://orbeon.org/oxf/xml/formatting"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <xforms:model>
            <xforms:instance id="data">
                <root xmlns="">
                    <theCountry/>
                </root>                    
            </xforms:instance>
           
            <xforms:instance id="countries">
                <countries xmlns="">
                    <country>                
                        <label>United Kingdom</label>
                        <id>uk</id>                        
                    </country>
                    <country>
                        <label>Scotland</label>                        
                        <id>scotland</id>
                    </country>
                    <country>
                        <label>Wales</label>
                        <id>wales</id>                        
                    </country>
                </countries>
            </xforms:instance>
        </xforms:model>  
    </head>
   
    <body>
    <xforms:select1 ref="instance('data')/theCountry" selection="open"
        incremental="true" appearance="xxforms:autocomplete">
            <xforms:itemset nodeset="instance('countries')/country">
                <xforms:value ref="id"/>
                <xforms:label ref="label"/>                
            </xforms:itemset>
        </xforms:select1>
    </body>
</html>




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Auto complete bug

Erik Bruchez
Administrator
Dave,

It is a "feature" that the autocomplete control disregards labels
entirely and only work with values.

This is motivated by the fact that what the user enters in the field is
a value, not a label, as that is what is stored into the instance data
node to which the control is bound. So it seemed to make sense to
display values as well in the completion list and simply ignore labels.

This said labels could also be displayed optionally or in addition to
the value.

Or did I misunderstand the issue?

-Erik

David Sinclair wrote:

> Hi,
>
> I think there is a bug with the autocomplete mechanism for select1.  
> Basically it seems that the id is being used instead of the label.   The
> xform at the bottom of this shows the problem in the sandbox.
>
> In one of our apps we use the autocomplete where some labels have spaces
> in them and others do not.  In this case it allows you to select labels
> that do not have spaces, but those that have spaces the id is used.  I
> have not been able to reproduce this in a simple example though...
>
> Dave
>
> <html xmlns:xs="http://www.w3.org/2001/XMLSchema"
>      xmlns:xforms="http://www.w3.org/2002/xforms"
>      xmlns:ev="http://www.w3.org/2001/xml-events"
>      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>      xmlns:xi="http://www.w3.org/2001/XInclude"
>      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>      xmlns:f="http://orbeon.org/oxf/xml/formatting"
>      xmlns:xhtml="http://www.w3.org/1999/xhtml"
>      xmlns="http://www.w3.org/1999/xhtml">
>
>    <head>
>        <xforms:model>
>            <xforms:instance id="data">
>                <root xmlns="">
>                    <theCountry/>
>                </root>                               </xforms:instance>
>                       <xforms:instance id="countries">
>                <countries xmlns="">
>                    <country>                                      
> <label>United Kingdom</label>
>                        <id>uk</id>                        
>                    </country>
>                    <country>
>                        <label>Scotland</label>                        
>                        <id>scotland</id>
>                    </country>
>                    <country>
>                        <label>Wales</label>
>                        <id>wales</id>                        
>                    </country>
>                </countries>
>            </xforms:instance>
>        </xforms:model>      </head>
>       <body>
>    <xforms:select1 ref="instance('data')/theCountry" selection="open"
>        incremental="true" appearance="xxforms:autocomplete">
>            <xforms:itemset nodeset="instance('countries')/country">
>                <xforms:value ref="id"/>
>                <xforms:label ref="label"/>                          
> </xforms:itemset>
>        </xforms:select1>
>    </body>
> </html>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Auto complete bug

David Sinclair
Hi Erik,

I am not sure I understand your answer - why is this a good idea for
autocomplete but not for an ordinary select1?  Dont see what the
difference is here.

We need to internationalize our app and having a French speaker get
suggestions in English is not very good.  Also, we want labels to be
able to contain spaces but use codes in the data (just seems like a good
idea because sequences are space delimited for example).  There are also
cases where codes already exist (e.g.  iso language codes)  ... but you
dont want the user to choose 'en', you want them to be able to choose
'English'

Dave



Erik Bruchez wrote:

> Dave,
>
> It is a "feature" that the autocomplete control disregards labels
> entirely and only work with values.
>
> This is motivated by the fact that what the user enters in the field
> is a value, not a label, as that is what is stored into the instance
> data node to which the control is bound. So it seemed to make sense to
> display values as well in the completion list and simply ignore labels.
>
> This said labels could also be displayed optionally or in addition to
> the value.
>
> Or did I misunderstand the issue?
>
> -Erik
>
> David Sinclair wrote:
>> Hi,
>>
>> I think there is a bug with the autocomplete mechanism for select1.  
>> Basically it seems that the id is being used instead of the label.  
>> The xform at the bottom of this shows the problem in the sandbox.
>>
>> In one of our apps we use the autocomplete where some labels have
>> spaces in them and others do not.  In this case it allows you to
>> select labels that do not have spaces, but those that have spaces the
>> id is used.  I have not been able to reproduce this in a simple
>> example though...
>>
>> Dave
>>
>> <html xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>      xmlns:xforms="http://www.w3.org/2002/xforms"
>>      xmlns:ev="http://www.w3.org/2001/xml-events"
>>      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>>      xmlns:xi="http://www.w3.org/2001/XInclude"
>>      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>>      xmlns:f="http://orbeon.org/oxf/xml/formatting"
>>      xmlns:xhtml="http://www.w3.org/1999/xhtml"
>>      xmlns="http://www.w3.org/1999/xhtml">
>>
>>    <head>
>>        <xforms:model>
>>            <xforms:instance id="data">
>>                <root xmlns="">
>>                    <theCountry/>
>>                </root>                               </xforms:instance>
>>                       <xforms:instance id="countries">
>>                <countries xmlns="">
>>                    <country>                                      
>> <label>United Kingdom</label>
>>                        <id>uk</id>                        
>>                    </country>
>>                    <country>
>>                        <label>Scotland</label>                        
>>                        <id>scotland</id>
>>                    </country>
>>                    <country>
>>                        <label>Wales</label>
>>                        <id>wales</id>                        
>>                    </country>
>>                </countries>
>>            </xforms:instance>
>>        </xforms:model>      </head>
>>       <body>
>>    <xforms:select1 ref="instance('data')/theCountry" selection="open"
>>        incremental="true" appearance="xxforms:autocomplete">
>>            <xforms:itemset nodeset="instance('countries')/country">
>>                <xforms:value ref="id"/>
>>                <xforms:label ref="label"/>                          
>> </xforms:itemset>
>>        </xforms:select1>
>>    </body>
>> </html>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.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
> ObjectWeb mailing lists service home page: http://www.objectweb.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Auto complete bug

Erik Bruchez
Administrator
Dave,

The original purpose of the autocomplete control was to address use
cases like Google Suggests, or completion of a value from data that
comes from a database (e.g. enter the first letters of an author name), etc.

With this in mind, what the user enters is a *value*, not a label. What
the user enters is directly stored into the instance. The autocompletion
is just a tool to help the user type the value faster!

Maybe think of it as an xforms:input with autocompletion rather than an
xforms:select1 (although the reality is something between the two).

It seems like what you want is just completion in a combo box, in other
words completion in a closed selection, not completion in an open
selection, but this is not what the current autocomplete provides.

You may still be able to use the current autocomplete control for your
purposes, but you have to:

o Feed the itemset with values that are in fact your "labels"
o Somehow (validation) prevent the user to enter his own country names
o Convert the "label" stored as a value in the instance back to a real
   code

-Erik

David Sinclair wrote:

> Hi Erik,
>
> I am not sure I understand your answer - why is this a good idea for
> autocomplete but not for an ordinary select1?  Dont see what the
> difference is here.
>
> We need to internationalize our app and having a French speaker get
> suggestions in English is not very good.  Also, we want labels to be
> able to contain spaces but use codes in the data (just seems like a good
> idea because sequences are space delimited for example).  There are also
> cases where codes already exist (e.g.  iso language codes)  ... but you
> dont want the user to choose 'en', you want them to be able to choose
> 'English'
>
> Dave
>
>
>
> Erik Bruchez wrote:
>> Dave,
>>
>> It is a "feature" that the autocomplete control disregards labels
>> entirely and only work with values.
>>
>> This is motivated by the fact that what the user enters in the field
>> is a value, not a label, as that is what is stored into the instance
>> data node to which the control is bound. So it seemed to make sense to
>> display values as well in the completion list and simply ignore labels.
>>
>> This said labels could also be displayed optionally or in addition to
>> the value.
>>
>> Or did I misunderstand the issue?
>>
>> -Erik
>>
>> David Sinclair wrote:
>>> Hi,
>>>
>>> I think there is a bug with the autocomplete mechanism for select1.  
>>> Basically it seems that the id is being used instead of the label.  
>>> The xform at the bottom of this shows the problem in the sandbox.
>>>
>>> In one of our apps we use the autocomplete where some labels have
>>> spaces in them and others do not.  In this case it allows you to
>>> select labels that do not have spaces, but those that have spaces the
>>> id is used.  I have not been able to reproduce this in a simple
>>> example though...
>>>
>>> Dave
>>>
>>> <html xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>      xmlns:xforms="http://www.w3.org/2002/xforms"
>>>      xmlns:ev="http://www.w3.org/2001/xml-events"
>>>      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>>>      xmlns:xi="http://www.w3.org/2001/XInclude"
>>>      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>>>      xmlns:f="http://orbeon.org/oxf/xml/formatting"
>>>      xmlns:xhtml="http://www.w3.org/1999/xhtml"
>>>      xmlns="http://www.w3.org/1999/xhtml">
>>>
>>>    <head>
>>>        <xforms:model>
>>>            <xforms:instance id="data">
>>>                <root xmlns="">
>>>                    <theCountry/>
>>>                </root>                               </xforms:instance>
>>>                       <xforms:instance id="countries">
>>>                <countries xmlns="">
>>>                    <country>                                      
>>> <label>United Kingdom</label>
>>>                        <id>uk</id>                        
>>>                    </country>
>>>                    <country>
>>>                        <label>Scotland</label>                        
>>>                        <id>scotland</id>
>>>                    </country>
>>>                    <country>
>>>                        <label>Wales</label>
>>>                        <id>wales</id>                        
>>>                    </country>
>>>                </countries>
>>>            </xforms:instance>
>>>        </xforms:model>      </head>
>>>       <body>
>>>    <xforms:select1 ref="instance('data')/theCountry" selection="open"
>>>        incremental="true" appearance="xxforms:autocomplete">
>>>            <xforms:itemset nodeset="instance('countries')/country">
>>>                <xforms:value ref="id"/>
>>>                <xforms:label ref="label"/>                          
>>> </xforms:itemset>
>>>        </xforms:select1>
>>>    </body>
>>> </html>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> --
>>> 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
>>> ObjectWeb mailing lists service home page: http://www.objectweb.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
>> ObjectWeb mailing lists service home page: http://www.objectweb.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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Auto complete bug

David Sinclair
Hi Erik,

I get you about the autocomplete now, I guess expressed like this it
makes sense to ignore the labels.

We actually do want open selection in this case though - we want to
suggest a list of 'Fields of Study' but not restrict the user to this
choice.  In 2.8 we used a select1 with selection ="open" but this is not
present in 3.0.   Your suggestion still applies we just dont have to do
the validation.

Thanks and enjoy the wedding!

Dave

Erik Bruchez wrote:

> Dave,
>
> The original purpose of the autocomplete control was to address use
> cases like Google Suggests, or completion of a value from data that
> comes from a database (e.g. enter the first letters of an author
> name), etc.
>
> With this in mind, what the user enters is a *value*, not a label.
> What the user enters is directly stored into the instance. The
> autocompletion is just a tool to help the user type the value faster!
>
> Maybe think of it as an xforms:input with autocompletion rather than
> an xforms:select1 (although the reality is something between the two).
>
> It seems like what you want is just completion in a combo box, in
> other words completion in a closed selection, not completion in an
> open selection, but this is not what the current autocomplete provides.
>
> You may still be able to use the current autocomplete control for your
> purposes, but you have to:
>
> o Feed the itemset with values that are in fact your "labels"
> o Somehow (validation) prevent the user to enter his own country names
> o Convert the "label" stored as a value in the instance back to a real
>   code
>
> -Erik
>
> David Sinclair wrote:
>> Hi Erik,
>>
>> I am not sure I understand your answer - why is this a good idea for
>> autocomplete but not for an ordinary select1?  Dont see what the
>> difference is here.
>>
>> We need to internationalize our app and having a French speaker get
>> suggestions in English is not very good.  Also, we want labels to be
>> able to contain spaces but use codes in the data (just seems like a
>> good idea because sequences are space delimited for example).  There
>> are also cases where codes already exist (e.g.  iso language codes)  
>> ... but you dont want the user to choose 'en', you want them to be
>> able to choose 'English'
>>
>> Dave
>>
>>
>>
>> Erik Bruchez wrote:
>>> Dave,
>>>
>>> It is a "feature" that the autocomplete control disregards labels
>>> entirely and only work with values.
>>>
>>> This is motivated by the fact that what the user enters in the field
>>> is a value, not a label, as that is what is stored into the instance
>>> data node to which the control is bound. So it seemed to make sense
>>> to display values as well in the completion list and simply ignore
>>> labels.
>>>
>>> This said labels could also be displayed optionally or in addition
>>> to the value.
>>>
>>> Or did I misunderstand the issue?
>>>
>>> -Erik
>>>
>>> David Sinclair wrote:
>>>> Hi,
>>>>
>>>> I think there is a bug with the autocomplete mechanism for
>>>> select1.  Basically it seems that the id is being used instead of
>>>> the label.   The xform at the bottom of this shows the problem in
>>>> the sandbox.
>>>>
>>>> In one of our apps we use the autocomplete where some labels have
>>>> spaces in them and others do not.  In this case it allows you to
>>>> select labels that do not have spaces, but those that have spaces
>>>> the id is used.  I have not been able to reproduce this in a simple
>>>> example though...
>>>>
>>>> Dave
>>>>
>>>> <html xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>      xmlns:xforms="http://www.w3.org/2002/xforms"
>>>>      xmlns:ev="http://www.w3.org/2001/xml-events"
>>>>      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>>>>      xmlns:xi="http://www.w3.org/2001/XInclude"
>>>>      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>>>>      xmlns:f="http://orbeon.org/oxf/xml/formatting"
>>>>      xmlns:xhtml="http://www.w3.org/1999/xhtml"
>>>>      xmlns="http://www.w3.org/1999/xhtml">
>>>>
>>>>    <head>
>>>>        <xforms:model>
>>>>            <xforms:instance id="data">
>>>>                <root xmlns="">
>>>>                    <theCountry/>
>>>>                </root>                              
>>>> </xforms:instance>
>>>>                       <xforms:instance id="countries">
>>>>                <countries xmlns="">
>>>>                    <country>                                      
>>>> <label>United Kingdom</label>
>>>>                        <id>uk</id>                        
>>>>                    </country>
>>>>                    <country>
>>>>                        
>>>> <label>Scotland</label>                        
>>>>                        <id>scotland</id>
>>>>                    </country>
>>>>                    <country>
>>>>                        <label>Wales</label>
>>>>                        <id>wales</id>                        
>>>>                    </country>
>>>>                </countries>
>>>>            </xforms:instance>
>>>>        </xforms:model>      </head>
>>>>       <body>
>>>>    <xforms:select1 ref="instance('data')/theCountry" selection="open"
>>>>        incremental="true" appearance="xxforms:autocomplete">
>>>>            <xforms:itemset nodeset="instance('countries')/country">
>>>>                <xforms:value ref="id"/>
>>>>                <xforms:label
>>>> ref="label"/>                           </xforms:itemset>
>>>>        </xforms:select1>
>>>>    </body>
>>>> </html>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>> ObjectWeb mailing lists service home page:
>>>> http://www.objectweb.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
>>> ObjectWeb mailing lists service home page: http://www.objectweb.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
>> ObjectWeb mailing lists service home page: http://www.objectweb.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
> ObjectWeb mailing lists service home page: http://www.objectweb.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Auto complete bug

Erik Bruchez
Administrator
Dave,

> I get you about the autocomplete now, I guess expressed like this it
> makes sense to ignore the labels.
> We actually do want open selection in this case though - we want to
> suggest a list of 'Fields of Study' but not restrict the user to this
> choice.  In 2.8 we used a select1 with selection ="open" but this is not
> present in 3.0.   Your suggestion still applies we just dont have to do
> the validation.

I see. "classic" open selection on xforms:select1 has not made it yet. I
entered an RFE:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=306098&group_id=168&atid=350207

> Thanks and enjoy the wedding!

Thanks!

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws