on 01-11-2006 10:01 PM
Hello
How could I access the text for a drop down by key?
Thank you
Hi georgeta,
You can get the text of the drop downbykey by using getText() method of IModifiableSimpleValueSet object.
try this sample code in the event handler of ur dropdown by keyselect.
IWDAttributeInfo attributeInfo2 = wdContext.getNodeInfo().getAttribute(<attribute name>);
IModifiableSimpleValueSet set = attributeInfo2.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
String text=set.getText(<keyvalue>);
hope it helps for u
With Regards
Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Balaram,
I hav one doubt regarding tex of DDK.
My requirement is like:I need to dispaly the selected dropdown in the next Prj.
I hav to prj lik:Creation ,modification
In creation i hav to choos one value from the DDk and i need to display the same in modification.
But,Instead of getting text i am getting Key in the Modification.
Plz help me out in this......
Regards,
Lavanya.G
Lavanya:
If you're using a simple type for your DDK, you could check the option for generating the class representation for the enum. That way, you could create the simple type from the value (from the context or a DB)
That is, when you're loading the values for the view's context, you can do it by creating an instance of the class that represents your simple type
MyEnumClass nodeVal = MyEnumClass.valueOf(key);
wdContext.currentContextElement().setMyValue(nodeVal);
Hope this helps
name1 is one string attribute where we r storing required value........
Sample code for getting the key of the message from its message text.
Field keys[] = IMessage<compname>.class.getFields();
String keyname = "";
for(int index=0;index<keys.length;index++)
{
keyname = keys[index].getName();
IWDTextAccessor ta = wdComponentAPI.getTextAccessor();
if(ta.getText(keyvalue).equals(wdcontext.currentcontextelement.<drope down attribute>))
{
wdcontext.currentcontextelement.setname1(keyname);
}
}
ur ans is in name1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.