on 07-03-2007 3:18 PM
Hello folks,
Does someone know how to fill DropDownByKey component dynamically, i.e. how to fill it without entering static values. I would like to use Simple Value Selector that I fill by calling some RFC and not by static population of Value, Description pair. Thanks in advance.
Kind Regards,
Aleksandar
HI,
Create a value attribute(Say DDValue) of type string and bind it to value property of DDByKey.
Then after calling RFC, do the following
IWDAttributeInfo att=wdContext.getNodeInfo().getAttribute(IPrivate<ViewName>View.IContextElement.DDValue);
ISimpleTypeModifiable ss=att.getModifiableSimpleType();
IModifiableSimpleValueSet sss=ss.getSVServices().getModifiableSimpleValueSet();
for(int i=0;i<rfcMasterNode.size();i++)
{
rfcEl=rfcMasterNode.getrfcMasterElementAt(i);
sss.put(""+rfcEl.getKeyattrib(),rfcEl.getValueAttrib());//PUTTING KEY AND VALUE FROM RFC Node
}
Regards
Fahad Hansa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use DropDownByIndex(DDBI) also for your key,Description pair,
provided that a single node has both key,Value as attributes.
From your model node map the attribute that you want to display as
description in the DropDown with the texts property of DropDownByIndex.
After the value is slelected in the drop down get the key value as
wdContext.current<Node>Element.getKey();
This will return you the key of the selected description.
Say,
Context
+ Product (RFC node)
---ProductID (key attribute)
---ProductName (description attribute)
Map the attribute ProductName with the texts property of the DDBI.
Thats all.No coding nothing.
In the action where you want the key of the selected value
wdContext.currentProductElement.getProductID();
try this and let me know
Hai ,
You use DDBK when you are going to display static data like countries, states..
better to use DDBIndex for Dynamic values
context
|-AA
|-a
bind a to DDBI
String arr[]={"a","b","c"};
for(int i=0;i<arr.length;i++){
IPrivateXXView.IAAElement ele=wdContext.createAAElement();// here AA is the node
ele.setA(arr<i>);
wdContext.nodeAA().addElement(ele);
}
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you dont want "drop down by Key", You can take "drop down by index" for this you just need to map the drop down by index to your model nodes attribute.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hope your problem is solved. right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.