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" <
avernet@...>
To: <
ops-users@...>
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 <
jeanluc2008@...> 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
ops-users@... mailing
> list.
> To unsubscribe: mailto:
ops-users-unsubscribe@...
> For general help: mailto:
sympa@...?subject=help
> OW2 mailing lists service home page:
http://www.ow2.org/wws>
--
You receive this message as a subscriber of the
ops-users@... mailing list.
To unsubscribe: mailto:
ops-users-unsubscribe@...
For general help: mailto:
sympa@...?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws