cancel
Showing results for 
Search instead for 
Did you mean: 

multiple selection from drop down : NWDS7.0 SPS18

Former Member
0 Kudos

Hi Team,

How can achieve multiple selection from drop down? I am working on NWDS7.0 SPS18. I have known the concept of item list box... is that's the only option?.

Is it possible to make it as filter option that we have in our Microsoft excel.

Customer wants select either/all options @once from drop down.

TIA,

Vanita K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create a node with cardinality 0-n and selection property set to 0-n

Create a table UI element and bind this node as a datasource to this table.

Set the selection mode property of this table as auto or multi

Once this is done, populate the node with some data elements.

When you run the application, you will be able to select multiple rows from the table.

To get the selected rows, use below code on the action of some button

	wdComponentAPI.getMessageManager().reportSuccess("Selected rows are");
	int n = wdContext.nodeEmployeeData().size();//size of node binded with table
	int leadSelected = wdContext.nodeEmployeeData().getLeadSelection();
	for (int i = n - 1; i >= 0; --i)
	{
		if (wdContext.nodeEmployeeData().isMultiSelected(i) || leadSelected == i )
		{
			IEmployeeDataElement employeeDataElement = wdContext.nodeEmployeeData().getEmployeeDataElementAt(i);
			wdComponentAPI.getMessageManager().reportSuccess("ID: "+employeeDataElement.getID()+"Name: "+employeeDataElement.getName());
		}
	}

For adding sorting and filtering functionality to the table follow the article

[WDJ - A Generic Java Class for Filtering Web Dynpro Tables|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60d5b593-ba83-2910-28a9-a7a7c7f5996f]

Regards,

Amol

Former Member
0 Kudos

Thanks Amol.

Given 12points all together. Thanks again.

Answers (2)

Answers (2)

Former Member
0 Kudos

You cannot have multi-selection for a DropDownBy*.

Former Member
0 Kudos

Hi,

You can also use table UI for this.

You can display multiple rows in a table with the filter and sort functionality and can allow to select multiple rows.

Regards,

Amol

Former Member
0 Kudos

Hi ,

yes ,go for table UI lement with slection propery set to Multiple.

Regards,

Govindu

Former Member
0 Kudos

Hi Amol ,

Thanks for the idea. Can you explain mewith small example here as this would be my first such imlementation.

-Vanita