on 08-22-2008 7:35 AM
Hi...everybody
I am creating Dropdown by index UI element and the
context atrributes dynamically.To bind multiple data to a dropdown
the cardinality property of the node should be 0..n or 1..n,
But i could not set the property of the dynamically created context node to 0..n ...
can any body suggest me..
I implemented the following code in WDDoModify View
IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
null,null);
IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
dbyindex.bindTexts(strinfo);
tc.addChild(dbyindex);
I could successfully display one value in the drop down,by adding the following code before the line tc.addchild(dbyindex);
IWDNode node1=wdContext.getChildNode("DynamicNode",0);
IWDNodeElement nodeElement=node1.createElement();
nodeElement.setAttributeValue("Value","Hello");
node1.addElement(nodeElement);
but when
i am trying to bind multiple values i am getting Exception ,,,,
hi
you are getting the exception because of cardinality property.
i.e true,false and
you are trying to add morethan one element.
so,if you want to add morethan one than one element you have to set the cardinality property to true,true (or) false,true.
In your code do the following modification for changing the cardinality.
For 0..n -->false,true
1..n-->true,true
IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
null,null);
IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
dbyindex.bindTexts(strinfo);
tc.addChild(dbyindex);
hope this will solve your problem.
In addchild(..) the parameters are
addChild("Name ,
Element class for model node ,
Is singleton? ,
Cardinality ,
Selection cardinality ,
Initialise lead selection? ,
Datatype ,
Supplier function ,
Disposer function);
Regards
sowmya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Make use of the following method
IWDNodeInfo addChild(String name,
Class elementClass,
boolean singleton,
CMICardinality collection,
CMICardinality selection,
boolean initializeLeadSelection,
IStructure structure);
Ex:
IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode", null, true, CMICardinality.ONE_TO_MANY, CMICardinality.ONE, true, null);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.