It's not clear to me what the checkbox "checkness" represents: is the checkbox used to select rows? or to set some boolean value of the row?
If the former, then have a look at http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellTable // Checkbox column. This table will uses a checkbox column for selection. // Alternatively, you can call cellTable.setSelectionEnabled(true) to enable // mouse selection. Column<ContactInfo, Boolean> checkColumn = new Column<ContactInfo, Boolean>( new CheckboxCell(true, false)) { @Override public Boolean getValue(ContactInfo object) { // Get the value from the selection model. return selectionModel.isSelected(object); } }; The value of the cell depends on the selection state of the row object (dependsOnSelection=true) but the cell itself does not handle selection (it doesn't call setSelected() on the SelectionModel, but defers to the CellTable; hence handlesSelection=false) On Friday, May 11, 2012 7:01:53 AM UTC+2, Qrunk wrote: > > Perhaps the question is not yet clear, I will try to rephrase it : > > We are trying to create a DataGrid with editable cells, in which one of > them is CheckBoxCell.we are using selection model as *SingleSelectionModel > * . > Now this CheckboxCell takes two arguments in its constructor, i.e. > > */** > * Construct a new {@link CheckboxCell} that optionally controls > selection. > * > * @param dependsOnSelection true if the cell depends on the selection > state > * @param handlesSelection true if the cell modifies the selection state > */* > public CheckboxCell(boolean dependsOnSelection, boolean > handlesSelection) { > } > > > Now after adding this CheckboxCell to one of the columns of the *grid*, > it gets rendered with no problems. > But the following issues are noticed : > > 1) Here while adding the CheckboxCell we with no parameters with in the > CheckboxCell constructor we get *SelectionChangeEvent* gets fired > correctly, but in order to check/uncheck the checkbox we have to click > twice on the check box cell. > 2) And while using > > Column<T, Boolean> checkCellGridColumn = new Column<T, > Boolean>( new CheckBoxCell( false, true ){ > > SelectionChangeEvent is not fired. > > *What should be done so that I can get the check box checked at just one > click and the selection event should also be fired on that click on the > check box cell.* > > Thanks. > > > > On Thursday, 10 May 2012 09:19:41 UTC+5:30, Qrunk wrote: >> >> Any help on this issue will be very helpful >> >> On Wednesday, 9 May 2012 16:00:25 UTC+5:30, Qrunk wrote: >>> >>> I am using the following constructor to create a checkboxcell in an >>> editable data grid. >>> >>> *CheckboxCell(false, true)* >>> >>> When I use this and click at any place in the row, selection change >>> event does not fire and I am using *Single selection model* . >>> >>> When I use, >>> >>> *CheckboxCell();* >>> >>> Selection change event fires on the row but, >>> 1) We have click twice to check or uncheck the check box cell. >>> 2) if we check or uncheck in the checkboxcell, the value will reverted >>> as soon as I click anywhere. >>> >>> I am trying to figure out the solution, but not successful yet. Any help >>> would be appreciated. >>> >>> Am using *GWT 2.4.0 * >>> >> > On Thursday, 10 May 2012 09:19:41 UTC+5:30, Qrunk wrote: >> >> Any help on this issue will be very helpful >> >> On Wednesday, 9 May 2012 16:00:25 UTC+5:30, Qrunk wrote: >>> >>> I am using the following constructor to create a checkboxcell in an >>> editable data grid. >>> >>> *CheckboxCell(false, true)* >>> >>> When I use this and click at any place in the row, selection change >>> event does not fire and I am using *Single selection model* . >>> >>> When I use, >>> >>> *CheckboxCell();* >>> >>> Selection change event fires on the row but, >>> 1) We have click twice to check or uncheck the check box cell. >>> 2) if we check or uncheck in the checkboxcell, the value will reverted >>> as soon as I click anywhere. >>> >>> I am trying to figure out the solution, but not successful yet. Any help >>> would be appreciated. >>> >>> Am using *GWT 2.4.0 * >>> >> > On Thursday, 10 May 2012 09:19:41 UTC+5:30, Qrunk wrote: >> >> Any help on this issue will be very helpful >> >> On Wednesday, 9 May 2012 16:00:25 UTC+5:30, Qrunk wrote: >>> >>> I am using the following constructor to create a checkboxcell in an >>> editable data grid. >>> >>> *CheckboxCell(false, true)* >>> >>> When I use this and click at any place in the row, selection change >>> event does not fire and I am using *Single selection model* . >>> >>> When I use, >>> >>> *CheckboxCell();* >>> >>> Selection change event fires on the row but, >>> 1) We have click twice to check or uncheck the check box cell. >>> 2) if we check or uncheck in the checkboxcell, the value will reverted >>> as soon as I click anywhere. >>> >>> I am trying to figure out the solution, but not successful yet. Any help >>> would be appreciated. >>> >>> Am using *GWT 2.4.0 * >>> >> -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/tHf473ixifUJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
