Check Box in Table Component

Hi,I have a table component with a checkbox in it.There is one button called 'select all', which will select all the check boxes on its action.any one can help me in this regard plelase?thanks in advance.
[241 byte] By [joshmachinea] at [2007-11-27 9:15:00]
# 1
Hi!Read this: http://blogs.sun.com/winston/entry/multiple_selection_table1I think it will be helpful for You.Thanks,Roman.
-Grif-a at 2007-7-12 22:03:42 > top of Java-index,Development Tools,Java Tools...
# 2
Thanks for your reply Roman,But is not useful.My problem is, on Clicking the button all the check boxes in table should get selected. Just Like it happens in address book.Thanks again regards,joshmachine
joshmachinea at 2007-7-12 22:03:42 > top of Java-index,Development Tools,Java Tools...
# 3

To do what you want, you might have to get the data provider's row keys and step through them one at a time.

Are you using a TableSelectPhaseListener? If so, you'd have to call the listener's setSelected(RowKey, Object) method to highlight the row.

You'd also have to call each checkbox's setSelected method to select the checkbox.

I've encountered similar problems, and this is the way I worked around it. It's not too bad if there aren't too many rows in the table.

Of course, there may be an easier way to do this, but I haven't found it yet.

Futeleufu_Johna at 2007-7-12 22:03:42 > top of Java-index,Development Tools,Java Tools...
# 4

Thanks for your advice Mr. John,

Firstly I am not using TableSelectPhaseListener.

Secondly I am having large no of records (More than 50,000), so Calling each checkbox's set selected method is not not a good idea,

I am trying hard to solve this issue but still couldn't find any solution on that

still if can find something please let me know!!!!

regards,

joshmachine

joshmachinea at 2007-7-12 22:03:42 > top of Java-index,Development Tools,Java Tools...