on 11-21-2006 11:48 AM
Dear SDN Members,
I have added some static data into a drop down list box by key UI element using the procedure specified in value help tutorial.
Now i want to display the value selected in a dropdown list box on view whenever i select an item in a dropdown list box.
Can any one put here the code part relating to this.
Your help will be awarded.
Thanks in advance,
Regards,
Sireesha.B
Hi,
I think you can all the attributes in pirticular node.
Suppose NodeX contains your fropdownkey elements.
Simple doing this code.
String value=wdContext.currentNodeXElement.get<yourattributeName>();
wdComponentAPI.getMessageManager().reportSuccess(value);
This would be helps you.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sireesha,
You want to display value based on the key selected in dropdown list. If you want to do like that
1) Create a context attribute for ex: key_value
2)In the properties of the attribute select the calculated as true.
3)It will create getter and setter methods for your attribute.
4)Go to implementation add the following code in getter method of your attribute
String attributeName = IPrivateCreate.IContextElement.KEY;
//KEY is your dropdown key attribute not the value attribute.
IWDAttributeInfo attributeInfo = element.node().getNodeInfo().getAttribute(attributeName);
ISimpleTypeModifiable simpleType = attributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueset = simpleType.getSVServices().getModifiableSimpleValueSet();
Object key = element.getAttributeAsText(attributeName);
return valueset.getText(key);
Regards
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Assuming that you have used a simple type enumeration to prepare your value set and that you have created a context attribute of that simple type, you can use this code:
String key = wdContext.currentContextElement().get<your attribute name>();
Map enumVal = wdContext.getContext().getRootNode().getNodeInfo().getAttribute("<your attribute name>").getSimpleType().getEnumerationTexts();
wdComponentAPI.getMessageManager().reportSuccess(enumVal.get(key).toString());
Regards,
Satyajit.
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 selectedKey API for this.
Check http://help.sap.com/saphelp_nw04/helpdata/en/3d/1eef3d5e10af5ee10000000a114084/frameset.htm
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.