on 02-21-2007 11:58 PM
maintained the values as simple data types under dictionary. How to preset the dropdown with a particular value by default instead of empty line. Thanks!.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pankaj,
You can do this dynamically n set the initial value to any of the value,
use the following code:-
Say you have an attribute 'drop_by_key' mapped to the dropdown by key UI element. Then you can set the first key as selected as
String attributeName = IPrivateMyTestView.IContextElement.DROP__BY__KEY;
IWDAttributeInfo attributeInfo = wdThis.wdGetContext().getNodeInfo().getAttribute(attributeName);
ISimpleType simpleType = attributeInfo.getSimpleType();
ISimpleValueSet valueset = simpleType.getSVServices().getValues();
valueset.putValues("<Insert values in value set>");
Object key = valueset.getKey(0);
wdContext.currentContextElement().setDrop_by_key((String)key);
this way you can assign any value in the getKey() function ..
Hope this helps
Regards
Jeet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Before populating the values into dropdown set a value for context attribute.
wdContext.currentContextElement.setV_Name ("Select a value");
and then populate your list according to your requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pankaj,
Set the key of the value you want to display, to the context variable of drop down.Then the corresponding value will be displayed
ie. If u r having key-Value pairs like
Key1-->Value1
Key2-->Value2
then, inorder to display Value2 at start,
assign Key2 to the context of dropdownByKey
ie. wdContext.currentContextElement().set<con.Var>(Key2);
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
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.