Multiple objects cannot have the same "id", turn on debug mode and you
should see a warning like:
WARNING: Redefining #txt from #txt to LzText:
Here's a simple way to make it work:
<combobox *datapath="."* editable="false" >
<textlistitem datapath="ds2:/root/data" text="$path{'@data2'}"
value="$path{'@data2'}" />
<handler name="onselect">
*this.datapath.setNodeAttribute("data1", this.value);*
</handler>
</combobox>
The <combobox> gets a datapath pointing to the current <data> element
and whenever a new <textlistitem> is selected, "setNodeAttribute(..)" is
called on the datapath to update the element.
- André
hi,
I am trying to use combobox in grid.
When I select 2 in combobox at the second row,
I want the grid to show like this:
------------- ---------------
SELECT DATA
------------- ---------------
A
------------- ---------------
2 2
------------- ---------------
C
------------- ---------------
D
------------- ---------------
BUT the grid shows like this:
------------- ---------------
SELECT DATA
------------- ---------------
A
------------- ---------------
2 B
------------- ---------------
C
------------- ---------------
2
------------- ---------------
Any help?
Regards,
minamotonoason(ason)
OpenLaszlo User in Japan
--------------------------
<canvas proxied="false" bgcolor="0xeeeeee">
<dataset name="ds">
<root>
<data data1="A" />
<data data1="B" />
<data data1="C"/>
<data data1="D"/>
</root>
</dataset>
<dataset name="ds2">
<root>
<data data2="1"/>
<data data2="2"/>
<data data2="3"/>
<data data2="4"/>
<data data2="5"/>
</root>
</dataset>
<grid datapath="ds:/root">
<gridcolumn text="SELECT">
<combobox editable="false">
<textlistitem datapath="ds2:/root/data"
text="$path{'@data2'}"
value="$path{'@data2'}" />
<handler name="onselect">
txt.setAttribute('text',this.value);
</handler>
</combobox>
</gridcolumn>
<gridcolumn text="DATA">
<text id="txt" datapath="@data1"/>
</gridcolumn>
</grid>
</canvas>
---
p.s.
I held OpenLaszlo seminar at 2010.3.13 at Kobe in Japan
OSC means Open Source Conference.
Many people came to see OpenLaszlo.
Photos are athttp://www.openlaszlo-ason.com/