You could also use a CellTable with two columns instead. The first
column then should have a CheckboxCell which depends on the selection.
It's value (as given by the getValue of the Column) should be equal to
selectionModel.isSelected(object) and its ValueUpdater should update
the selection. The second column renders your custom ContactCell.

On Feb 9, 10:29 am, Nettar <[email protected]> wrote:
> Thank you very much John, it worked very well..
>
> On Feb 8, 6:14 pm, John LaBanca <[email protected]> wrote:
>
>
>
>
>
>
>
> > 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.

Reply via email to