on 04-20-2006 5:38 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Change your code to:
String[] ddval = {"Select Value", "PVal", "QVal", "RVal", "SVal", "TVal"};
for (int ix = 0; ix < ddval.length; ix++)
{
IPrivateMyView.IDropDownValuesElement el = wdContext.nodeDropDownValues().createDropDownValuesElement();
el.setValue(ddval[ix]);
wdContext.nodeDropDownValues().addElement(el);
}
wdContext.nodeDropDownValues().setLeadSelection(1);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi OJ,
As suggested Rajeev, replace the line
"<b>wdContext.bind(NodeElements)</b>);" to
"<b>wdContext.nodeDropDownValues().bind(NodeElements)</b>".
U were trying to bind directly to Main context which is not allowed. also make sure that the NodeDropDownValues has cardinality of 0..n or 1..n
Thanks
Srikant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.