You can control selection by passing a DefaultSelectionEventManager with a
custom EventTranslator as a second arg into setSelectionModel.
It might look something like this:
class MyEventTranslator extends EventTranslator() {
public boolean clearCurrentSelection(CellPreviewEvent<T> event) {
return false;
}
public SelectAction translateSelectionEvent(CellPreviewEvent<T> event) {
// Handle the event.
NativeEvent nativeEvent = event.getNativeEvent();
if ("click".equals(nativeEvent.getType()) && *
!isSelectingFavoriteStatusCheckbox()*) {
return SelectionAction.TOGGLE;
}
}
}
cellTable.setSelectionModel(selectionModel,
DefaultSelectionEventManager.createCustomManager(new MyEventTranslator());
Thanks,
John LaBanca
[email protected]
On Tue, Feb 8, 2011 at 2:38 AM, Nettar <[email protected]> wrote:
> Hello,
>
> I am working on a contacts list application for which I am using
> CellList with a custom ContactCell. I need to have a checkbox against
> each contact in the list to tell if the contact is the favorite one.
>
> Now, I want to capture 2 types of events on the contact cell:
>
> 1. clicking on the checkbox must toggle the contact's favorite status
> 2. clicking elsewhere on the contact cell must select the contact
>
> I have not been able to differentiate these 2 events. If I add a
> SelectionModel to the CellList, it fires even if I am clicking on the
> checkbox.
>
> Any suggestions please..
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> 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.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
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.