0

Selectbox items with label and value

asked 2016-11-20 09:50:45 +0800

GaneshRocky gravatar image GaneshRocky
1

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.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-11-21 10:01:41 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-11-20 09:50:45 +0800

Seen: 36 times

Last updated: Nov 21 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More