Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 09, 2008 at 07:04 AM

    Thanks a lot all

    Add comment
    10|10000 characters needed characters exceeded