Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error using DropDownByIndex

Hi

I'm trying to use DropDownByIndex element. I have a node and one attribute in it. The cardinality of the node is 0...n.

When I deploy the application, I get an error saying:

<i>com.sap.tc.webdynpro.progmodel.context.ContextException: Node(ManojView): must not bind more than one element to a Node of cardinality 0..1 or 1..1</i>

The code I am using is:

String[] ddval = new String[] {"Select Value", "PVal", "QVal", "RVal", "SVal", "TVal"};

	List NodeElements = new ArrayList();
	for(int i=0;i<ddval.length;i++ )
	{
		IPrivateMyView.IDropDownValuesElement el = wdContext.createDropDownValuesElement();
		el.setValue(ddval<i>);
		NodeElements.add(el); 
	}
	  
	wdContext.bind(NodeElements);
    wdContext.nodeDropDownValues().setLeadSelection(1);

I am using <b>NWDS 7.0</b> and deploying on NW2004s. What could be wrong?

Thanks

Manoj

replied

Hi,

Use this code it will work:

String[] ddval = new String[] {"Select Value", "PVal", "QVal", "RVal", "SVal", "TVal"};

List NodeElements = new ArrayList();

for(int i=0;i<ddval.length;i++ )

{

IPrivateMyView.IDropDownValuesElement el = wdContext.createDropDownValuesElement();

el.setValues(ddval<i>);

NodeElements.add(el);

}

wdContext.nodeDropDownValues().bind(NodeElements);//change made here

wdContext.nodeDropDownValues().setLeadSelection(1);

Regards,

Rajeev

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question