Closed notalentgeek closed 8 years ago
There are a few options available: http://haxeui.org/try.jsp?layoutId=GzzRK5a
<?xml version="1.0" encoding="utf-8" ?>
<vbox>
<script>
function onChange1() {
log.text = myList1.text + ", ";
log.text += myList1.selectedIndex + ", ";
log.text += myList1.selectedItems[0].data.text + ", ";
}
function onChange2() {
log.text = myList2.text + ", ";
log.text += myList2.selectedIndex + ", ";
log.text += myList2.selectedItems[0].data.text + ", ";
// this will work for json data, will be null otherwise
log.text += myList2.selectedItems[0].data.something;
}
</script>
<hbox>
<listselector id="myList1" text="Select" width="100" onchange="onChange1()">
<array>Hello,World</array>
</listselector>
<listselector id="myList2" text="Select" width="100" onchange="onChange2()">
<json>
[
{"text": "Hello", "something": "else1"},
{"text": "World", "something": "else2"}
]
</json>
</listselector>
</hbox>
<textinput width="200" height="100" id="log" multiline="true" />
</vbox>
Exactly what I need thanks Ian!
However, http://haxeui.org/try.jsp is not working on Linux, Google Chrome. There is only Layout tab but no Result tab.
Yeah, i think there are some flash issues... I think if you keep refreshing it works eventually (not totally sure), either way, eventually the whole haxeui.org is going to get a new version.
Glad it helped! Can this be closed?
Yes just close this. Thank you!
I am sorry if this inappropriate place to ask for.
I have a ListSelector that contains "Hello", "World!". For example I selected "Hello". When I do listSelectorObject.selectedIndex it returns 0. But what if I want to return "Hello" string instead of 0. Is there any possible way to do this?
For additional info, my listSelectorObject is actually inputted using dataSource.createFromString() from Array that is generated depend on another ListSelector value.