cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

retrieving two separate values from xui/combobox/listitem selection

Newbie

retrieving two separate values from xui/combobox/listitem selection

I can retrieve the selected listitem's label from the combobox's value from the following XUI window:

<window title="VIOR" topics&quot;=" xmlns:ev="http://www.w3c.org/2001/xml-events">
<combobox id="topicid" value="Select" a=" topic&quot;=" type="dropdownlist">
<listitem label="1234|BusinessTopic1"/">
...
</combobox>
<button label="OK" type="accept">

</button>
<button label="Cancel" type="cancel">

</button>
</window>

using the following function:

function save_topicid(selected_topic) {
sep_pos = index(selected_topic,"|");
topic_name_start = sep_pos + 1;
length_topicid = sep_pos - 1;
if (length_topicid > 0) {
global saved_topicid = substr(selected_topic, 1, length_topicid);
}
response("The saved_topicid is " . saved_topicid);
global saved_topicname = substr(selected_topic, topic_name_start);
response("The saved_topicname is " . saved_topicname);
}

But I would like to be able to separate the topicid and topicname in something like this:

<listitem topicid="1234" label="BusinessTopic1"/">

But I can't figure out how to get to anything but the label which is actually stored, programmatically in the combobox's value attribute.

Has anyone done anything like this before?

------
Paul Nagai


Tags (2)
Announcements