Friday, September 24, 2010

(GWT 2.1 M3 question) Mouse events in a custom Cell (Data Presentation Widgets)

Hi all,

Using GWT 2.1 M1 I had a working example of a CellList with a custom-
built Cell implementation that expects click events, double click
events, right click events, and so on. The effect was that the
CellList is really a calendar of sorts, each "page" was a list of days
in a month. Therefore, each Cell was a day.

The structure was:

public class CalendarCellList extends CellList<CalendarDayModel>
... and...
public class CalendarCell extends AbstractCell<CalendarDayModel>

... and then in the CalendarCell I override the methods:

public void render(AppCalendarDay calendarDay, Object viewData,
StringBuilder sb)
... and...
public void onBrowserEvent(Element parent, AppCalendarDay value,
Object viewData, NativeEvent event, ValueUpdater<AppCalendarDay>
valueUpdater)

... to give me the control I needed over the visual rendering and the
light-weight browser event handling.

It worked perfectly until I refactored my code for GWT 2.1 M3. I
haven't changed any code in these two classes, but now my events are
simply not handled. In fact I have a great big Window.alert("Hello!")
inside my onBrowserEvent override method, but it's never getting
called. Debugging isn't much help because the method is never entered.

Has anyone experienced something similar, or know what needs to be
done differently?

Thanks,
Paul

--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment