The *displayed* auto-complete values in a combo box
are populated with the 'value' attribute from the underlying nodeset. They
should be from the 'label' attribute. The control is used as below and what I
see in the box is all the values for the code attribute, instead of the name
subelement
<xforms:select1 ref="..."
appearance="xxforms:autocomplete" selection="open"
incremental="true">
<xforms:label>Parent widget:</xforms:label> <xforms:itemset nodeset="instance('form-data')/widgetList/widget"> <xforms:label ref="name"/> <xforms:value ref="@code"/> </xforms:itemset> </xforms:select1> Orbeon Forms Release
3.6.0.200803121728
-- 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 |
Administrator
|
Jean-Luc,
That's actually a feature, sort of. An open selection allows you only to enter custom *values*, not custom labels. We only support open selection in autocomplete mode. In order for autocompletion to occur properly, it is desirable that the use sees how the values he enters match the existing values in the itemset. So we have chosen to display the values only and to ignore the labels. We could have gone in the other direction and shown the labels, but then you as a developer must ensure that the labels match the values. Alternatively, a possibility would be to actually display the label as well in the list. We are not too happy about the current state of autocomplete anyway. We would like to upgrade to the YUI widget at some point. -Erik On Apr 25, 2008, at 11:06 AM, Jean Luc wrote: > The *displayed* auto-complete values in a combo box are populated > with the 'value' attribute from the underlying nodeset. They should > be from the 'label' attribute. The control is used as below and what > I see in the box is all the values for the code attribute, instead > of the name subelement > > > <xforms:select1 ref="..." appearance="xxforms:autocomplete" > selection="open" incremental="true"> > <xforms:label>Parent widget:</xforms:label> > <xforms:itemset nodeset="instance('form-data')/widgetList/widget"> > <xforms:label ref="name"/> > <xforms:value ref="@code"/> > </xforms:itemset> > </xforms:select1> > Orbeon Forms Release 3.6.0.200803121728 Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.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 |
I see the reason. There's a pratical problem that you may have an
alternative solution. In my form, I can optionally set a "parent widget" for a given widget. The parent is selected from the widgets in the form. Because the parent is optional, I need to leave to have an empty entry in the list and here's the problem: <xforms:select1 appearance="minimal"> <xforms:itemset nodeset="widgets/widget"> <xforms:label ref="name"/> <xforms:value ref="code"/> </xforms:itemset> </xforms:select1> gives a dropdown box with all the widgets in the form. Being bound to the model, it does *not* contain an empty value as well, so this would force every widget to have a parent. Not good. If I change to <xforms:select1 appearance="xxforms:autocomplete" selection="open"> then I can leave the field entry, but in the dropdown list I see the codes, not the names? Is there an elegant solution for this? Thanks, JL ----- Original Message ----- From: "Erik Bruchez" <[hidden email]> To: <[hidden email]> Sent: Monday, April 28, 2008 1:15 PM Subject: [ops-users] Re: bug: combo box values > Jean-Luc, > > That's actually a feature, sort of. An open selection allows you only > to enter custom *values*, not custom labels. We only support open > selection in autocomplete mode. In order for autocompletion to occur > properly, it is desirable that the use sees how the values he enters > match the existing values in the itemset. > > So we have chosen to display the values only and to ignore the labels. > We could have gone in the other direction and shown the labels, but > then you as a developer must ensure that the labels match the values. > > Alternatively, a possibility would be to actually display the label as > well in the list. > > We are not too happy about the current state of autocomplete anyway. > We would like to upgrade to the YUI widget at some point. > > -Erik > > On Apr 25, 2008, at 11:06 AM, Jean Luc wrote: > >> The *displayed* auto-complete values in a combo box are populated >> with the 'value' attribute from the underlying nodeset. They should >> be from the 'label' attribute. The control is used as below and what >> I see in the box is all the values for the code attribute, instead >> of the name subelement >> >> >> <xforms:select1 ref="..." appearance="xxforms:autocomplete" >> selection="open" incremental="true"> >> <xforms:label>Parent widget:</xforms:label> >> <xforms:itemset nodeset="instance('form-data')/widgetList/widget"> >> <xforms:label ref="name"/> >> <xforms:value ref="@code"/> >> </xforms:itemset> >> </xforms:select1> >> Orbeon Forms Release 3.6.0.200803121728 > > -- > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > http://www.orbeon.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 |
Administrator
|
Jean Luc,
On Fri, May 2, 2008 at 9:16 AM, Jean Luc <[hidden email]> wrote: > If I change to > <xforms:select1 appearance="xxforms:autocomplete" selection="open"> > > then I can leave the field entry, but in the dropdown list I see the codes, > not the names? Since this is a select1, you don't have worry about spaces in the names. So you could have your <xforms:select1 appearance="xxforms:autocomplete" selection="open"> bound to an itemset so what's displayed is the name. That means that what goes into the node the <xforms:select1> is bound to is also the name. So you would bound it to "another node", and have the value of the "regular node" computed based on the value of "another node" by looking up what the value is for that name. Would this make sense? 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 -- 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 |
Hi Alessandro,
I've tried the approach (which sounds feasible in theory) but found a practical problem: the calculation didn't take place. Is there anythhing wrong in the calculate expression? I am blind to the error :) I tried to debug as much as possible in the Instance Inspector, but it has a limitation: I couldn't evaluate XPaths pointing to attributes, just to elements, even if they were correct. Thank you, JL Below is the relevant excerpt (unpopulated with data albeit in reality there are values). The model has 2 instances: one with the widgets, one used as a local storage. <xforms:model> <xforms:instance id="form-data" xmlns=""> <test-data> <test> <widgetList> <widget> <widgetCode/> <name/> <model/> </widget> </widgetList> </test> </test-data> </xforms:instance> <xforms:instance id="local-data" xmlns="" > <local-data> <parent-widget name="" code=""/> </local-data> </xforms:instance> <xforms:bind nodeset="instance('local-data')/parent-widget/@code" readonly="false" calculate="//widgetList/widget[name=instance('local-data')/parent-widget/@name]/@code"/> Later in the view there is a combo box bound to the widget names. When I select an item, the code attribute in the <parent-widget> elements of the 'local-data' instance doesn't change. <xforms:select1 ref="instance('local-data')/parent-widget/@name" appearance="xxforms:autocomplete" selection="open" incremental="true"> <xforms:label>Parent Widget:</xforms:label> <xforms:itemset nodeset="instance('form-data')/test/widgetList/widget"> <xforms:label ref="name"/> <xforms:value ref="name"/> </xforms:itemset> </xforms:select1> ----- Original Message ----- From: "Alessandro Vernet" <[hidden email]> To: <[hidden email]> Sent: Friday, May 02, 2008 7:35 PM Subject: [ops-users] Re: Re: Re: bug: combo box values (or "how to add an empty value to a model-bound control" ?) > Jean Luc, > > On Fri, May 2, 2008 at 9:16 AM, Jean Luc <[hidden email]> wrote: >> If I change to >> <xforms:select1 appearance="xxforms:autocomplete" selection="open"> >> >> then I can leave the field entry, but in the dropdown list I see the >> codes, >> not the names? > > Since this is a select1, you don't have worry about spaces in the > names. So you could have your <xforms:select1 > appearance="xxforms:autocomplete" selection="open"> bound to an > itemset so what's displayed is the name. That means that what goes > into the node the <xforms:select1> is bound to is also the name. So > you would bound it to "another node", and have the value of the > "regular node" computed based on the value of "another node" by > looking up what the value is for that name. Would this make sense? > > 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 > -------------------------------------------------------------------------------- > > -- > 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 |
In reply to this post by Alessandro Vernet
Hi Alessandro,
I've tried the approach (which sounds feasible in theory) but found a practical problem: the calculation didn't take place. Is there anythhing wrong in the calculate expression? I am blind to the error :) I tried to debug as much as possible in the Instance Inspector, but it has a limitation: I couldn't evaluate XPaths pointing to attributes, just to elements, even if they were correct. Thank you, JL Below is the relevant excerpt (unpopulated with data albeit in reality there are values). The model has 2 instances: one with the widgets, one used as a local storage. <xforms:model> <xforms:instance id="form-data" xmlns=""> <test-data> <test> <widgetList> <widget> <widgetCode/> <name/> <model/> </widget> </widgetList> </test> </test-data> </xforms:instance> <xforms:instance id="local-data" xmlns="" > <local-data> <parent-widget name="" code=""/> </local-data> </xforms:instance> <xforms:bind nodeset="instance('local-data')/parent-widget/@code" readonly="false" calculate="//widgetList/widget[name=instance('local-data')/parent-widget/@name]/@code"/> Later in the view there is a combo box bound to the widget names. When I select an item, the code attribute in the <parent-widget> elements of the 'local-data' instance doesn't change. <xforms:select1 ref="instance('local-data')/parent-widget/@name" appearance="xxforms:autocomplete" selection="open" incremental="true"> <xforms:label>Parent Widget:</xforms:label> <xforms:itemset nodeset="instance('form-data')/test/widgetList/widget"> <xforms:label ref="name"/> <xforms:value ref="name"/> </xforms:itemset> </xforms:select1> ----- Original Message ----- From: "Alessandro Vernet" <[hidden email]> To: <[hidden email]> Sent: Friday, May 02, 2008 7:35 PM Subject: [ops-users] Re: Re: Re: bug: combo box values (or "how to add an empty value to a model-bound control" ?) > Jean Luc, > > On Fri, May 2, 2008 at 9:16 AM, Jean Luc <[hidden email]> wrote: >> If I change to >> <xforms:select1 appearance="xxforms:autocomplete" selection="open"> >> >> then I can leave the field entry, but in the dropdown list I see the >> codes, >> not the names? > > Since this is a select1, you don't have worry about spaces in the > names. So you could have your <xforms:select1 > appearance="xxforms:autocomplete" selection="open"> bound to an > itemset so what's displayed is the name. That means that what goes > into the node the <xforms:select1> is bound to is also the name. So > you would bound it to "another node", and have the value of the > "regular node" computed based on the value of "another node" by > looking up what the value is for that name. Would this make sense? > > 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 > -------------------------------------------------------------------------------- > > -- > 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 |
In reply to this post by Alessandro Vernet
Hi Alessandro,
I've tried the approach (which sounds feasible in theory) but found a
practical problem: the calculation didn't take place. Is there anythhing wrong
in the calculate expression? I am blind to the error :) I tried to debug as much
as possible in the Instance Inspector, but it has a limitation: I couldn't
evaluate XPaths pointing to attributes, just to elements, even if they were
correct.
Thank you,
JL
Below is the relevant excerpt (unpopulated with data albeit in reality
there are values). The model has 2 instances: one with the widgets, one used as
a local storage.
<xforms:model>
<xforms:instance id="form-data" xmlns=""> <test-data> <test> <widgetList> <widget> <widgetCode/> <name/> <model/> </widget> </widgetList> </test> </test-data> </xforms:instance> <xforms:instance id="local-data" xmlns="" >
<local-data> <parent-widget name="" code=""/> </local-data> </xforms:instance> <xforms:bind nodeset="instance('local-data')/parent-widget/@code" readonly="false" calculate="//widgetList/widget[name=instance('local-data')/parent-widget/@name]/@code"/> Later in the view there is a combo box bound to the widget names. When I
select an item, the code attribute in the <parent-widget> elements of the
'local-data' instance doesn't change.
<xforms:select1
ref="instance('local-data')/parent-widget/@name"
appearance="xxforms:autocomplete" selection="open"
incremental="true">
<xforms:label>Parent Widget:</xforms:label> <xforms:itemset nodeset="instance('form-data')/test/widgetList/widget"> <xforms:label ref="name"/> <xforms:value ref="name"/> </xforms:itemset> </xforms:select1> ----- Original Message -----
From: "Alessandro Vernet" <[hidden email]>
To: <[hidden email]>
Sent: Friday, May 02, 2008 7:35 PM
Subject: [ops-users] Re: Re: Re: bug: combo box values (or "how to add an
empty value to a model-bound control" ?) > > On Fri, May 2, 2008 at 9:16 AM, Jean Luc <[hidden email]> wrote: >> If I change to >> <xforms:select1 appearance="xxforms:autocomplete" selection="open"> >> >> then I can leave the field entry, but in the dropdown list I see the codes, >> not the names? > > Since this is a select1, you don't have worry about spaces in the > names. So you could have your <xforms:select1 > appearance="xxforms:autocomplete" selection="open"> bound to an > itemset so what's displayed is the name. That means that what goes > into the node the <xforms:select1> is bound to is also the name. So > you would bound it to "another node", and have the value of the > "regular node" computed based on the value of "another node" by > looking up what the value is for that name. Would this make sense? > > Alex -- 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 |
Administrator
|
In reply to this post by Jean Luc-2
Jean Luc,
On Mon, May 5, 2008 at 2:30 PM, Jean Luc <[hidden email]> wrote: > I've tried the approach (which sounds feasible in theory) but found a > practical problem: the calculation didn't take place. Is there anythhing > wrong in the calculate expression? I am blind to the error :) I tried to > debug as much as possible in the Instance Inspector, but it has a > limitation: I couldn't evaluate XPaths pointing to attributes, just to > elements, even if they were correct. Sorry for the trouble, but would be able to put this together into an example that runs in the sandbox, so we can test this quickly? 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 -- 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 |
Hi Alessandro,
A test form is below and attached, as requested
(I'm including you in To: as the list server wraps lines). I've just tested it
with your public sandbox.
There are 3 widgets and a combo box in which you
select the name of a widget which is bound to
instance('local-data')/parent-widget/@name
instance('local-data')/parent-widget/@code is a
calculated field and should be updated, but it's not - that's visible with the
inspector.
Your help is appreciated.
<html
xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml.xsd http://www.w3.org/2002/xforms http://www.w3.org/2002/xforms/xforms.xsd"> <head> <xforms:model> <xforms:instance xmlns="" id="form-data"> <test-data> <test> <widgetList> <widget code="test_alpha"> <name>alpha</name> <parentCode /> </widget> <widget code="test_beta"> <name>beta</name> <parentCode>test_alpha</parentCode> </widget> <widget code="test_gamma"> <name>gamma</name> <parentCode/> </widget> </widgetList> </test> </test-data> </xforms:instance> <xforms:instance xmlns="" id="local-data"> <local-data> <parent-widget name="" code=""/> </local-data> </xforms:instance> <xforms:bind nodeset="instance('local-data')/parent-widget/@code" readonly="false" calculate="//widgetList/widget[name=instance('local-data')/parent-widget/@name]/@code"/> <xforms:submission method="post" id="form-submit" action="http://someurl" /> </xforms:model> </head> <body> <table> <xforms:repeat nodeset="test/widgetList/widget"> <tr> <td> <table> <tr> <td> <xforms:input ref="name"> <xforms:label>Name:</xforms:label> </xforms:input> </td> <td> <xforms:input ref="parentCode"> <xforms:label>Parent id:</xforms:label> </xforms:input> </td> </tr> </table> <br/> </td> </tr> </xforms:repeat> <tr> <td> <xforms:select1 ref="instance('local-data')/parent-widget/@name" appearance="xxforms:autocomplete" selection="open" incremental="true"> <xforms:label>Parent Widget:</xforms:label> <xforms:itemset nodeset="instance('form-data')/test/widgetList/widget"> <xforms:label ref="name"/> <xforms:value ref="name"/> </xforms:itemset> </xforms:select1> </td> </tr> </table> <br/> <br/> <xforms:submit submission="form-submit" ref="instance('form-data')"> <xforms:label>Submit</xforms:label> </xforms:submit> <widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/> </body> </html> ----- Original Message -----
From: "Alessandro Vernet" <[hidden email]>
To: <[hidden email]>
Sent: Monday, May 05, 2008 8:17 PM
Subject: [ops-users] Re: Re: Re: Re: Re: bug: combo
box values (or "how to add an empty value to a model-bound control"
?) > > On Mon, May 5, 2008 at 2:30 PM, Jean Luc <[hidden email]> wrote: >> I've tried the approach (which sounds feasible in theory) but found a >> practical problem: the calculation didn't take place. Is there anythhing >> wrong in the calculate expression? I am blind to the error :) I tried to >> debug as much as possible in the Instance Inspector, but it has a >> limitation: I couldn't evaluate XPaths pointing to attributes, just to >> elements, even if they were correct. > > Sorry for the trouble, but would be able to put this together into an > example that runs in the sandbox, so we can test this quickly? > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > Orbeon's Blog: http://www.orbeon.com/blog/ > Twitter - http://twitter.com/avernet > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: [hidden email] > For general help: [hidden email] > 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 x.xhtml (3K) Download Attachment |
Administrator
|
Jean-Luc,
On Tue, May 6, 2008 at 8:30 AM, Jean Luc <[hidden email]> wrote: > There are 3 widgets and a combo box in which you select the name of a widget > which is bound to instance('local-data')/parent-widget/@name > instance('local-data')/parent-widget/@code is a calculated field and should > be updated, but it's not - that's visible with the inspector. This is because of the calculate in the <xforms:bind>. It is evaluated in the context of the node pointed by nodeset, so it can't find the //widgetList elements, which are in another instance. Instead you need to write instance('form-data')//widgetList/... <xforms:bind nodeset="instance('local-data')/parent-widget/@code" readonly="false" calculate="instance('form-data')//widgetList/widget[name=instance('local-data')/parent-widget/@name]/@code"/> See your updated example attached. 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 -- 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 x.xhtml (5K) Download Attachment |
Yipeee, it worked :) Thanks!
----- Original Message ----- From: "Alessandro Vernet" <[hidden email]> To: "OPS Users" <[hidden email]> Sent: Wednesday, May 07, 2008 9:14 PM Subject: [ops-users] Re: Re: Re: Re: Re: Re: bug: combo box values (or "how to add an empty value to a model-bound control" ?) > Jean-Luc, > > On Tue, May 6, 2008 at 8:30 AM, Jean Luc <[hidden email]> wrote: >> There are 3 widgets and a combo box in which you select the name of a >> widget >> which is bound to instance('local-data')/parent-widget/@name >> instance('local-data')/parent-widget/@code is a calculated field and >> should >> be updated, but it's not - that's visible with the inspector. > > This is because of the calculate in the <xforms:bind>. It is evaluated > in the context of the node pointed by nodeset, so it can't find the > //widgetList elements, which are in another instance. Instead you need > to write instance('form-data')//widgetList/... > > <xforms:bind nodeset="instance('local-data')/parent-widget/@code" > readonly="false" > > calculate="instance('form-data')//widgetList/widget[name=instance('local-data')/parent-widget/@name]/@code"/> > > See your updated example attached. > > 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 > -------------------------------------------------------------------------------- > > -- > 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 |
Free forum by Nabble | Edit this page |