on 03-12-2008 6:08 PM
Hi, I made a RadioButton, binded to it "answerContext" and binded to it an Simple Type enumeration with two options, "Yes" and "No". Now I want to:
String answerContext = wdContext.currentElement().getAnswerContext();
but it provides "Type mismatch, cant convert from answerContext to String". So what type is it? (I checked int, boolean, no match as well).
Balmer,
Check if you mapped your simpletype to answerContext attribute correctly.
Also the code should be
String answerContext = wdContext.currentContextElement().getAnswerContext();
Try using RadioButtonGroupByIndex..
Chintan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Balmer,
During dictionary type creation if you check the Generate a class representation of enumeration then your code will be like this
<b>String answerContext = wdContext.currentContextElement().getAnswerContext().toString();</b>
wdComponentAPI.getMessageManager().reportSuccess("answerContext : "+ answerContext);
because wdContext.currentContextElement().getAnswerContext() will return a object of dictionary type.
Otherwise
String answerContext = wdContext.currentContextElement().getAnswerContext();
is fine.
answerContext is the value attribute under Context of dictionary type .
Regards,
Mithu
Hi,
I have tried the above mentioned prob and its working for me;
What i did:
Created a simple type name criteria Built-in type as string
value Description
A First
B Second
C Third
D Fourth
Add a UI Element RadioButtonGroupByKey
Bind it and in init method get the value in a string using your code
Check the entire; you must went wrong some where.
Regards
- Vinod
*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
please check the context attribute you have created whether it is string or of some other type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.