on 03-20-2008 9:52 AM
Hi,
i have implemented a checkBoxGroup. I thought that in a group only one value can be selected?
But in my Gruop every CheckBoxField can be selected. I want that only one field can checked and if an other get selected the first field is unselected and the new one is selected.
String[] values = {Value_1,Value_2,Value_3,...};
for (int i = 0; i < values.length; i++) {
IWDNodeElement elem = wdContext.nodeNodeName().createElement();
elem.setAttributeValue("attName", values<i>);
wdContext.nodeName().addElement(elem);
}
What you are looking for is called RadioButtonGroupBy{Index,Key}.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use radioButtonGroup which is more appropriate for your scenario as Armin said.
But for your purpose here is the solution:
1. Create two global variables ie in others section of the implementation tab as:
public static int j = 0;
public static boolean flag = false;
2. Create an action gor your CheckBoxGroup ie onToggle and implement it as:
if(flag){
wdContext.nodeMonthsOfYear().setSelected(j, false);
// Here MonthsOfYear is the node containing the attribute mapped to your checkBoxGroup texts property
}
Thats it.
Hope this helps.
thanks & regards,
Manoj
Edited by: Manoj Kumar on Mar 20, 2008 4:07 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
I know this is bad advice.
But just to correct my previous reply, i missed some points there. I went to edit that reply but it is showing i cant do that.
Hence, i am posting the same here. Just for sake of correctness.
For SAP User :
I missed the complete solution in my previous reply. Well offcourse you can ignore the solution as it is really not proper to use this solution for your purpose.
You can use radioButtonGroup which is more appropriate for your scenario as Armin said.
But for your purpose here is the solution:
1. Create two global variables ie in others section of the implementation tab as:
public static int j = 0;
public static boolean flag = false;
2. Create an action gor your CheckBoxGroup ie onToggle and implement it as:
if(flag){
wdContext.nodeMonthsOfYear().setSelected(j, false);
// Here MonthsOfYear is the node containing the attribute mapped to your checkBoxGroup texts property
}
3. In wdDoModify() write:
for(int i = 0;i<wdContext.nodeMonthsOfYear().size();i++){
if(wdContext.nodeMonthsOfYear().isMultiSelected(i)){
flag = true;
j = i;
break;
}
}
Thats it.
Hope this helps.
thanks & regards,
Manoj
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.