Dynamic labels in an itemset

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

Dynamic labels in an itemset

mjgraham
Hi,

I have an instance which is returned from a db query:

<xf:instance id="person">
  <exist:response>
    <Person>
      <Name Id="345">John Smith</Name>
      <Born>23 Sept 1925</Born>
      <Died>15 March 1993</Died>
   </Person>
   <Person>...
  </exist:response>
</xf:instance>

and I want a select1 based on this but I want the label to be a
concatenation of the Name, Born and Died dates but if I try:

<xforms:select1 ref="instance('refid')/refid" selection="closed">
  <xforms:itemset nodeset="instance('person')/Person">
    <xforms:label>
      <xforms:output value="concat(Name, ' (', Born, ' - ', Died, ')')"/>
    </xforms:label>
    <xforms:value ref="Name/@Id"/>
  </xforms:itemset>
</xforms:select1>

Unfortunately this just produces a blank label - how can I do want I
want to do?

    Cheers,

    Matthew



--
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: Dynamic labels in an itemset

Sam Chuparkoff
On Sun, 2006-10-29 at 23:32 -0800, Matthew Graham wrote:

> <xforms:select1 ref="instance('refid')/refid" selection="closed">
>   <xforms:itemset nodeset="instance('person')/Person">
>     <xforms:label>
>       <xforms:output value="concat(Name, ' (', Born, ' - ', Died, ')')"/>
>     </xforms:label>
>     <xforms:value ref="Name/@Id"/>
>   </xforms:itemset>
> </xforms:select1>
>
> Unfortunately this just produces a blank label - how can I do want I
> want to do?
This doesn't work for me either. As I'm new to xforms and orbeon,
that's not to say it should. Assuming the following does work:

  <xforms:itemset nodeset="instance('person')/Person">
    <xforms:label ref="Name"/>
    <xforms:value ref="Name/@Id"/>
  </xforms:itemset>

This produces blank labels for me:

  <xforms:itemset nodeset="instance('person')/Person">
    <xforms:label>foo</xforms:label>
    <xforms:value ref="Name/@Id"/>
  </xforms:itemset>

Should we be able to put element content into itemset labels? If not,
it seems the cleanest work-around is to bind the label to a calculated
value instead.

sdc





--
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: Dynamic labels in an itemset

Erik Bruchez
Administrator
Adrian, Sam:

You are right, this didn't work. Luckily the code required to make this
work was right there, so I fixed it. It should work now, and you should
now be able to use @ref or inline content in the CVS or next nightly build.

-Erik

Sam D. Chuparkoff wrote:

> On Sun, 2006-10-29 at 23:32 -0800, Matthew Graham wrote:
>> <xforms:select1 ref="instance('refid')/refid" selection="closed">
>>   <xforms:itemset nodeset="instance('person')/Person">
>>     <xforms:label>
>>       <xforms:output value="concat(Name, ' (', Born, ' - ', Died, ')')"/>
>>     </xforms:label>
>>     <xforms:value ref="Name/@Id"/>
>>   </xforms:itemset>
>> </xforms:select1>
>>
>> Unfortunately this just produces a blank label - how can I do want I
>> want to do?
>
> This doesn't work for me either. As I'm new to xforms and orbeon,
> that's not to say it should. Assuming the following does work:
>
>   <xforms:itemset nodeset="instance('person')/Person">
>     <xforms:label ref="Name"/>
>     <xforms:value ref="Name/@Id"/>
>   </xforms:itemset>
>
> This produces blank labels for me:
>
>   <xforms:itemset nodeset="instance('person')/Person">
>     <xforms:label>foo</xforms:label>
>     <xforms:value ref="Name/@Id"/>
>   </xforms:itemset>
>
> Should we be able to put element content into itemset labels? If not,
> it seems the cleanest work-around is to bind the label to a calculated
> value instead.
>
> sdc
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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