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

How to select checkbox values from checkbox group element

Hi All,

I have total 40 number of checkbox and i used checkboxgroup element. Depending upon the user 's selection(select/de-select),I have to retain the state of the checkbox.

I want to get which perticular checkbox the user has modified and to which state(true/false)

Thanks

Kiran

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2008 at 06:33 AM

    Hi,

    U can use below code for getting selected check box.

    for(int i=0;i<wdContext.node<node name>().size();i++)
    {
    
    if(wdContext.node<node name>().().isSelected(i))
    {
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+wdContext.node<node name>().().get<node name>().().ElementAt(i).get<attribute name>());
    }
    }
    

    put this code in action or wdModifyView()

    Regards,

    Surender Dahiya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2008 at 06:41 AM

    Hi,

    If a checkbox is toggled, the event onToggle is triggered. Event parameter checked contains the new state of the checkbox, property index contains the index of the toggled checkbox

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2008 at 06:56 AM

    Hi Surender,

    Thanks a lot for quick reply with solution.

    i have modified it with this :-

    "wdContext.node<Node_Name>().get<Node_Name>ElementAt(i).getAttributeValue(Attribute_Name));"

    it's working but it always showing first checkbox value with selected one.

    Thanks and Regards

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2008 at 07:03 AM

    Hi All,

    Thanks for your replies.

    I got solved this problem by execuing follow code:-

    if(wdContext.node<Node_Name>().isMultiSelected(i))

    {

    wdComponentAPI.getMessageManager().reportSuccess("selected "+

    wdContext.node<Node_Name>().get<Node_Name>ElementAt(i).getAttributeValue(<Attribute_Value>));

    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2008 at 07:04 AM

    Thanks a lot all

    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.