cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to Select/Deselect All checkboxes using single button

Former Member
0 Kudos

Hi all,

I want to Select/Deselect all check boxes in my table using single button. I tried using single button ,but it is not working correctly for all the cases.

Thanks&regards,

karthik.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Karthikeyan

1) Create Context Attribute "<b>Selected</b>" of type Boolean and bind the "<b>Selected</b>" value attribute to "<b>CheckBoxUIElement's</b>" <b>checked</b> property

2)Create a ToggleButtonUIElement

3) Bind "<b>Selected</b>" to <b>checked</b> property of ToggleButtonUIElement

4)Create action and bind that to <b>onToggle</b> property of ToggleButton

5)Do the Following

if(wdContext.currentContextElement().getSelected())
	wdContext.currentContextElement().setSelected(true);
	 else
	wdContext.currentContextElement().setSelected(false);

Regards

Chaitanya.A

Former Member
0 Kudos

Hi! Karthi,

Richard Armit has answered this problem in a very descriptive way, find that blog and get the solution.

regards,

Mithileshwar

Former Member
0 Kudos

Hi karthik..

You can do this ..

1.Create boolean variable..

2.Create Select all button..

write this code in Select all action ..

IPrivate<View>.I<Table>Node tNode=wdContext.node<Table>().;

for(int i=0;i<tNodesize();i++)

{

tNode.get><Table>ElementAt(i).setCheck(true);

}

Like Deselect all..

IPrivate<View>.I<Table>Node tNode=wdContext.node<Table>().;

for(int i=0;i<tNodesize();i++)

{

tNode.get><Table>ElementAt(i).setCheck(false);

}

Urs GS

Former Member
0 Kudos

Hi sathish,

I want to do both select and deselect in single button. I already tried this code ,It need two buttons one for selection and other for deselection.

Can u plz help for that...

Thanks and regards

karthik.

Former Member
0 Kudos

Hi,

Create an additional parameter to store the state of the button ex a context attribute as IsChecked -> type boolean.

Initially set this to true /false.

Then when the action is triggered do teh "!" on the attribute.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi karthik, do you mean you want togglebutton? when it is pushed, select all, and when it is up, deselect all?

If yes, try to use the ui element togglebutton. You use it the same way as button, but the look and feel of togglebutton is differnet than button. Try it, maybe this is what you want.