on 10-22-2007 1:55 PM
Hi everyone
I hav a node containing 2 attributes ie value n key. I am using drop down by index. Value attribute is bound to my drop dwn box. In key I am providing key value for the value. I need to hard code 3 value..Can anyone help me how to do so.
Thanks
Jaspreet Kaur
IPrivate<viewname>.I<nodename>Element ele = wdContext.node<nodename>().create<nodename>Element();
ele.setValue(<value>);
ele.setKey(<Key>);
wdContext.node<nodename).addElement(ele);
IPrivate<viewname>.I<nodename>Element ele1 = wdContext.node<nodename>().create<nodename>Element();
ele1.setValue(<value>);
ele1.setKey(<Key>);
wdContext.node<nodename).addElement(ele1);
IPrivate<viewname>.I<nodename>Element ele2 = wdContext.node<nodename>().create<nodename>Element();
ele2.setValue(<value>);
ele2.setKey(<Key>);
wdContext.node<nodename).addElement(ele2);
Warm Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Let the attributes in your node be 'key' and 'val'.
Then bind 'texts' property of the 'dropdown by index' to val.
Then write coding,
IPrivate<yourViewName>.I<yourNodename> myNode=wdContext.node<yourNodename>();
IPrivate<yourViewName>.I<yourNode'selementname> myElement;
<b>myElement=myNode.create<yourNodeElement>();
myNode.addElement(myElement);
myElement.setKey("K1");
myElement.setVal("Val1");</b>
Repeat the last 4 lines with your desired key and value.
thanks
Smitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Example for Data Binding of the DropDownByIndex UI Element:
Procedure at design time:
...
1. Create a view with the name TestView.
2. Insert the DropDownByIndex UI element as a container child of the TestView view. (Step 1)
3. Create the context structure, as described in step 2.
Create the context node X with the cardinality 0..n. Insert the value attribute y of the type String into this node. Then perform the data binding of the DropDownByIndex UI element in the Properties window of the View Designer. The texts property must be bound to the value attribute y with the context path description TestView.X.y (step 3).
The context path TestView.X.y describes the attribute y in the context node X of the view context of the TestView view.
You can fill the context with test data using the following controller implementation.
public void wdDoInit()
{
//@@begin wdDoInit()
String[] letters = new String []
{"A", "B", "C", "D"};
//Create context elements for the node "X"
List nodeElements = new ArrayList();
for (int i = 0; i <letters.length; ++i)
{
IPrivateTestView.IXElement xElement = wdContext.createXElement();
xElement.setY(letters<i>);
nodeElements.add(xElement);
}
//Bind node element list to the node
wdContext.nodeX().bind(nodeElements);
//Set nodes lead selection which determines the selected item
wdContext.nodeX().setLeadSelection(1);
//@@end
}
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look for info on dropdownbykey in this document:
And dropdownbyindex here:
http://help.sap.com/saphelp_nw70/helpdata/en/3b/f1754276e4c153e10000000a1550b0/content.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.