I'm trying to use a Combobox in my application.  I want the combobox to  
display a handful of predefined items but I want the currently selected  
item to be based on a value found in some XML.  I have something like this:

...
<dataset name="ds">
     <item value="10"/>
<dataset>
...

<view datapath="ds:/">
    <combobox editable="false" datapath="@value">
       <textlistitem text="5 minutes"  value="5"/>
       <textlistitem text="10 minutes" value="10"/>
       <textlistitem text="20 minutes" value="20"/>
    </combobox>
</view>
...

My idea was that the value of the combobox would be based on the 'value'  
attribute and when displayed the combobox would display the text '10  
minutes'.  Unfortunately it doesn't appear to work this way.  Instead, I  
see the text '10' in the combobox.

So, my question is simply this, given that I want to display a finite set  
of items in my combobox, where the text in the combobox is 'human  
readable', and the value in the XML is an 'internal' value, how do I hook  
things up so when the data in the XML changes, the combobox will select  
and display the textlistitem appropriate to the value in the datapath?

Thanks!


-- 
James Howe
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to