You are not logged in.

1

Wednesday, September 26th 2018, 6:33am

Combobox - If Selected Item

Hi,

I'd like to make an action that will depend on which option was selected in a combobox.

I'm trying this:


if(combobox[mycombo].selectedItem == item4,
call-this-action(); );


But I can't get it to work.

What am I doing wrong?

I could find the answer for this.

Thanks,

Daniel

2

Monday, October 1st 2018, 12:27am

Daniel,
Please note that the <combobox /> is translated to the krpano layer[] on onxmlcomplete event.
To refer to the combobox layer and item layers you need to follow the naming as written as:
(just reading from the <action name="combobox_additem" of the combobox.xml)

Source code

1
2
		<!-- create the item layer/textfield -->
		calc(itemlayername, 'comboboxitem_' + cbname + '_' + itemname);


Pavel