Skip to Content
author's profile photo Former Member
Former Member

CheckBoxGruop - SingleSelection

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); 
                }

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2008 at 10:15 AM

    What you are looking for is called RadioButtonGroupBy{Index,Key}.

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2008 at 10:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.