Re: CellTable and CeckboxCell

2010-09-02 Thread jaga
I got the multiple selection to work as I and Jocke want by adding a
ButtonCell adjacent to the CheckboxCell. The code is in Bike Shed.
The
ButtonCell is also bound to the Selection Model. This takes care of
what seem to be two bugs:
1) the CheckboxCell is not firing a setFieldUpdater event
2) the ButtonCell event is not fired correctly. Giving the table
something else to do, i.e., with the CheckboxCell, helps the event to
propagate correctly.
For the record I also use the Selection Model's selection change
listener to inform the presenter that a selection has changed.

On Aug 28, 4:17 pm, Thomas Broyer t.bro...@gmail.com wrote:
 On 27 août, 21:14, jocke eriksson jock...@gmail.com wrote:

  I have a column of CheckboxCells. The use case is pretty like the one for
  gmail, you can check a checkbox without jumping in to the message. So if it
  is not supported then i think that it should be, or some good workaround at
  least.

 And you are using the SelectionModel to jump to the message ? I
 think you'd rather use ClickableTextCell or similar, and jump from
 the ValueUpdater instead of SelectionModel (and you'd use 
 aMultiSelectionModelwith the CheckboxCell handling the selection).

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable and CeckboxCell

2010-08-28 Thread Thomas Broyer


On 27 août, 21:14, jocke eriksson jock...@gmail.com wrote:
 I have a column of CheckboxCells. The use case is pretty like the one for
 gmail, you can check a checkbox without jumping in to the message. So if it
 is not supported then i think that it should be, or some good workaround at
 least.

And you are using the SelectionModel to jump to the message ? I
think you'd rather use ClickableTextCell or similar, and jump from
the ValueUpdater instead of SelectionModel (and you'd use a
MultiSelectionModel with the CheckboxCell handling the selection).

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable and CeckboxCell

2010-08-27 Thread Thomas Broyer

On 27 août, 10:45, jocke eriksson jock...@gmail.com wrote:
 I having trouble with a CheckboxCell, the problem is that if a user clicks
 on the checkbox the event bubbles up to the row element. This behaver is not
 what I want, what is the best way to cancel the event from bubbling up.

Well, first, the event *has* to bubble up, that's the way Cell widgets
work (i.e. using the pattern known as event delegation), so you
actually don't want to cancel the event from bubbling up. I think
you rather don't want the click to update the SelectionModel.

It seems like there's a bug in CheckboxCell, which reverts the meaning
of its constructor flag (from what I understand from reading the
source code, note that I haven't done any test to confirm these
observations):
 - CheckBoxCell(true) will actually make the cell a simple checkbox,
while
 - CheckboxCell(false) will actually make it act like a select box
And CheckboxCell() defers to CheckboxCell(false)

I also think it should listen to click events rather than change
events, as I'm not sure every browser fires change events (CheckBox
uses click, not change); but that's another story.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable and CeckboxCell

2010-08-27 Thread jocke eriksson
That's correct I don't want the click to update the selectionModel. Creating
the Cell like new CheckboxCell(true); makes the SelectionModel to get no
events at all. On the other hand if I pass in false all events gets pass. I
guess I will have to use the Event.NativePreviewHandler

Regards Jocke

2010/8/27 Thomas Broyer t.bro...@gmail.com


 On 27 août, 10:45, jocke eriksson jock...@gmail.com wrote:
  I having trouble with a CheckboxCell, the problem is that if a user
 clicks
  on the checkbox the event bubbles up to the row element. This behaver is
 not
  what I want, what is the best way to cancel the event from bubbling up.

 Well, first, the event *has* to bubble up, that's the way Cell widgets
 work (i.e. using the pattern known as event delegation), so you
 actually don't want to cancel the event from bubbling up. I think
 you rather don't want the click to update the SelectionModel.

 It seems like there's a bug in CheckboxCell, which reverts the meaning
 of its constructor flag (from what I understand from reading the
 source code, note that I haven't done any test to confirm these
 observations):
  - CheckBoxCell(true) will actually make the cell a simple checkbox,
 while
  - CheckboxCell(false) will actually make it act like a select box
 And CheckboxCell() defers to CheckboxCell(false)

 I also think it should listen to click events rather than change
 events, as I'm not sure every browser fires change events (CheckBox
 uses click, not change); but that's another story.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable and CeckboxCell

2010-08-27 Thread Thomas Broyer


On 27 août, 12:09, jocke eriksson jock...@gmail.com wrote:
 That's correct I don't want the click to update the selectionModel. Creating
 the Cell like new CheckboxCell(true); makes the SelectionModel to get no
 events at all. On the other hand if I pass in false all events gets pass. I
 guess I will have to use the Event.NativePreviewHandler

Thinking about it, maybe it's not a supported use-case. I mean, if you
have editable cells, you should use a NoSelectionModel *or* have a
column of CheckboxCell used to select/unselect lines. I suspect you'll
have the exact same problem with any AbstractEditableCell, or
ButtonCell, ActionCell or ClickableTextCell.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable and CeckboxCell

2010-08-27 Thread jocke eriksson
I have a column of CheckboxCells. The use case is pretty like the one for
gmail, you can check a checkbox without jumping in to the message. So if it
is not supported then i think that it should be, or some good workaround at
least.

2010/8/27 Thomas Broyer t.bro...@gmail.com



 On 27 août, 12:09, jocke eriksson jock...@gmail.com wrote:
  That's correct I don't want the click to update the selectionModel.
 Creating
  the Cell like new CheckboxCell(true); makes the SelectionModel to get no
  events at all. On the other hand if I pass in false all events gets pass.
 I
  guess I will have to use the Event.NativePreviewHandler

 Thinking about it, maybe it's not a supported use-case. I mean, if you
 have editable cells, you should use a NoSelectionModel *or* have a
 column of CheckboxCell used to select/unselect lines. I suspect you'll
 have the exact same problem with any AbstractEditableCell, or
 ButtonCell, ActionCell or ClickableTextCell.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.