Topic
  • 2 replies
  • Latest Post - ‏2013-03-15T07:44:56Z by huub100759
huub100759
huub100759
48 Posts

Pinned topic Retrieving multiple checkboxes.

‏2013-03-14T15:10:23Z |
I added multiple checkboxes dynamically to a grid:
weekCheckBox DojoCheckBox = new DojoCheckBox{layoutData = new GridLayoutData{row = rij, column = kol};
wekenGrid.appendChild(weekCheckBox);
....

What is the best way to retrieve the values ('selected') from the checkboxes after the user has selected them?

Im using RBD 8.0.1.3

Thanks in advance

Huub Keulartz
Updated on 2013-03-15T07:44:56Z at 2013-03-15T07:44:56Z by huub100759
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: Retrieving multiple checkboxes.

    ‏2013-03-14T19:39:52Z  
    The trick is to add a unique id to the checkboxes when adding them dynamically.
    When checking which checkbox is checked, you have to read the childs from the parents div/box.

    for(t int 1 to box1.children.getSize())
          if(box1.children[t] isa DojoCheckBox)
             cb DojoCheckBox= box1.children[teller] as DojoCheckBox;
             if(cb.getSelected() == true)
                  ...
             end    
          end       
       end
    


    Now you can use cb.getID() to check which checkbox is checked.

    Greetings, Jeroen
    AMITS.
    Updated on 2014-03-25T04:35:46Z at 2014-03-25T04:35:46Z by iron-man
  • huub100759
    huub100759
    48 Posts

    Re: Retrieving multiple checkboxes.

    ‏2013-03-15T07:44:56Z  
    Jeroen

    You are the best. Thank you very much.!
    Had to make a few minor adjustments but it worked perfect.

    for(t int from 1 to wekenWelGrid.children.getSize())
    if(wekenWelGrid.children[t] isa DojoCheckBox)
    cb DojoCheckBox= wekenWelGrid.children[t] as DojoCheckBox;
    if(cb.selected == true)
    ...
    end
    end
    end

    Thanks again.

    Huub