uncheck(CheckBox) children of clicked Checkbox in a treetable

Hi,

I have created a tree-table and added checkbox to one of its column. Now i want to uncheck all the children of the clicked element.
I have tried it with getItemId’s but problem is, that i can’t get the id of currently checked element.

Any idea regarding this would be a great help.

Anyone???

I have used the following code to get the row id of the clicked checkbox,

CheckBox ck = new CheckBox();
		ck.setValue(true);
		ck.setImmediate(true);
		ck.setDebugId(Integer.toString(count));
		count++;

I have actually set the debug id while i was creating the checkbox, so by this i have got the rowid and
by using valueChangeListener, i have unchecked/checked its all childrens.

I know its not the best way but still it works for me. Anyone got any better idea then please let me know.

Maybe slightly cleaner would be to use AbstractComponent.setData(Object) and getData() rather than the debug ID.

Other possible solutions depend on the rest of your application.

Hi Kislay Kumar,
Can you please share check box with treetable. I need a similar kind of control. Thanks in advance…

Sure I will please let me know how you want to use checkbox. Do you want it in dropdown portion or you want to make a relationship for dropdown column to the checkbox column corresponding to each row as I have done it.

Hi Henri, Can you please tell me how i can count number of checked checkboxs in vaadin.