GWT CELLTABLE :How to handle event on checkbox header like gmail Inbox?.

964 views
Skip to first unread message

vaibhav bhalke

unread,
Aug 8, 2011, 1:56:54 AM8/8/11
to google-we...@googlegroups.com
Hi,

How to  handling event on checkbox header ? i.e After selection of headerCheckBox only records present in page should be selected. like Gmail we select headerCheckBox to do certain action.

Column<RecordInfo, Boolean> checkColumn = new Column<RecordInfo, Boolean>(
                new CheckboxCell(true, false)) {
            @Override
            public Boolean getValue(RecordInfo object) {
                // Get the value from the selection model.              
                return selectionModel.isSelected(object);
            }
        };
        final CheckboxCell checkbox = new CheckboxCell(true, false);
        final Header<Boolean> hdr = new Header<Boolean>(checkbox ) {
            @Override
            public Boolean getValue() {
               
                return false;// return true to see a checked checkbox.
            // How to get hdr checkbox values i.e checked and unchecked here ?
            }
        };

        cellTable.addColumn(checkColumn, hdr);



    // Added a selection model
        final SelectionModel<RecordInfo> selectionModel = new MultiSelectionModel<RecordInfo>(
                RecordData.RecordInfo.KEY_PROVIDER);
        cellTable.setSelectionModel(selectionModel,
                DefaultSelectionEventManager
                        .<RecordInfo> createCheckboxManager());



--
Best Regards,
Vaibhav Bhalke
About me : http://about.me/vaibhavbhalke





Raziel

unread,
Nov 22, 2011, 3:10:37 PM11/22/11
to google-we...@googlegroups.com
I think this is a bug in GWT: http://code.google.com/p/google-web-toolkit/issues/detail?id=7014

See the proposed workaround. It works perfectly fine for me.

Reply all
Reply to author
Forward
0 new messages