on 07-16-2007 10:02 AM
hi sdns,
Just a quick check. My WD program have a set of dropdown list (by key) which is derived and populated by a complex series of logic.
Now I need to update a textview of the description of dropdown list I select. I don't want to go through the complex codes again just to retrieve te descriptions but I want to directly access to the valueset to retrieve the description. I tried "gettext()" but it's giving me error.
Anyone kind enough to provide me some snippet of codes to directly access to the selected description of my dropdown list? points will be awarded for useful answers....thanks.
Jansen
Hi Jansen,
Let the attribute bound to DDKey be Val in Context.
You will be putting key-value to DDKey by
IWDAttributeInfo boutiqueInfo=wdContext.getNodeInfo()..getAttribute(IPrivate<View>.IContextElement.VAL);
ISimpleTypeModifiable stf1=boutiqueInfo.getModifiableSimpleType();
IModifiableSimpleValueSet svs=stf1.getSVServices().getModifiableSimpleValueSet();
To get the text of the dropDown, first get the key of the dropDown selected by
String key=wdContext.currentContextElement.getVal();
Now u can get the value of this key from the SVS variable of DDby Key
String ddValue=svs.getText(key);
The key is case sensitive, so ensure the case also.
U can check the existence of the key by
if(svs.containsKey(key))
and value by
if(svs.containsText(key))
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.
Hi Jansen,
For updating the textview ,u can make the context attribute(which is binded to text view) as calculated ,When u change the property of the attribute as calculated,it will create getter & setter methods.U can get the key from the SimpleType of the context attribute & get the description by passing the key in setter method.
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank sumit for your suggestion but unfortunate that cannot be done as my textview is to be concatenated with other values. Also my dropdown list values are non-string so direct binding.
I need to directly access to the text of the selected value then do this concatentating to get the final output of the textview.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.