cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Selection in Combo box

Former Member
0 Kudos

Hi,

I must be able to select multiple items from a combo box. What are the properties that i have to change in NWDS. Jus guide me to get this functionality done.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I hope you are working with webdynpro... then my solution wont work out..

Former Member
0 Kudos

Ya... i am working with webDynpro... could u tel me the solution for this in webDynpro

Former Member
0 Kudos

Hi,

Default selection mode of dropdownlistbox(Combobox) is Single Selection.To change it to MultiSelection ,You have assign a model to the dropdownlistbox.

<hbj:dropdownListBox id="Combobox"

model ="bean.model"

...... >

//bean class

public ListModelBean extends {

public com.sapportals.htmlb.DefaultListModel model;

public void setModel(DefaultListModel model) {

this.model = model;

}

}

in your business class after creating bean class instance

DefaultListModel model = new DefaultListModel();

model.addItem(..);// add the combobox items

model.setSingleSelection(false); //

ListModelBean.setModel(model);

can get the selected items by

String selectedItems[] = model.getMultiSelection();

Link URL for DefaultListModel

https://media.sdn.sap.com/javadocs/NW04/SPS15/hb/com/sapportals/htmlb/DefaultListModel.html

Regards

Ganesan S