on 06-27-2006 1:11 PM
Hello everyone,
I'm having some trouble finding a good example to show me how to use a simple radiobutton with only two choices ("yes" or "no") and how to bind that to a specific boolean variable in other context. Can anyone point me in the right direction ?
Thanks in advance
Nuno,
Try this:
1. Create attribute of type boolean.
2. Create RadioButtonGroupByKey and bind selectedKey to this attribute
3. Add the following to wdDoInit of controller:
final ISimpleValueSet svs = wdContext
.nodeMyNode().getNodeInfo().getAttribute("MyBooleanAttr")
.getSimpleType().getSVServices().getValues();
svs.clear();
svs.put(Boolean.FALSE, "No");
svs.put(Boolean.TRUE, "Yes");
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valery
The code is OK, but in case of internationalization of Yes/No words it's better to create new Simple type with Integer as built-in-type having enumeration with two values:
1 - Yes
2 - No
Attribute "MyBooleanAttr" must be of the simple type then.
PS: the attribute will be as Integer, not Boolean, I'm sorry for confusing
BR
Sergei
Message was edited by: Siarhei Pisarenka
Why not simply use a CheckBox in this case?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.