-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Combobox has comboitem tag to add items with seperate label and value. What is the euqalent tag to add items with seperate value and label to SelectBox. All the examples are showing to set a label, but How to associate a value with each label for selectbox item?
I am looking at selectbox to replace combobox as it is causing performance issues. Since entry into the field in question is to select item from dropdown, selectbox would work, but couldn't find any item tag respect to SelectBox.
Hello GaneshRocky,
Please refer to the following fiddle as an example on how to get the selected item:
http://zkfiddle.org/sample/266s6gs/3-SO-Quesetion-3383439#source-1
In the code check out the following:
@Listen("onSelect = #typesSelectbox")
public void changeType() {
Set<ValueType> types = typesModel.getSelection();
ValueType type = types.iterator().next();
lbltxt.setValue(type.getText());
lblvalue.setValue(type.getValue());
}
Best Regards,
Darksu
Asked: 2016-11-20 09:50:45 +0800
Seen: 46 times
Last updated: Nov 21 '16