Skip to Content
author's profile photo Former Member
Former Member

Multiple Selection in Combo box

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 07:35 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 07:48 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.