Need help with month tab in calendar

3 views
Skip to first unread message

David Becker

unread,
May 5, 2009, 6:52:27 PM5/5/09
to ftr-gwt...@googlegroups.com
When I have events on the month tab in the calendar, clicking on them
always sends an ADD event not an EDIT event. As far as I can trace
it, this is due to the MonthPanelDayPanel.onMouseUp() method firing
before the AbstractMonthField.onClick() method. I see on the
ftr-gwt-library page that you're working on 1.6 compatibility and the
new events model, so there's probably not a lot of incentive to
support 0.9.9 anymore, but I'd be grateful for any advice on how to
get this working. I thought it was working under a previous library
version, but I've different the code and can't see how it would have.
:(

Help! Thanks!

Rui Silva

unread,
May 6, 2009, 5:03:36 AM5/6/09
to ftr-gwt...@googlegroups.com
This is issue 53.
Status is fixed (haven't tested yet).
A workaround without changing the ftr-gwt-library-date, can be handling the browser click event and stopping the propagation of the event.
Like this:
 
public DefaultMonthField(DateRenderer renderer) {
    super(renderer);
    super.sinkEvents(Event.MOUSEEVENTS);
    (...)
}
 
(...)
 
@Override
public void onBrowserEvent(Event event) {
    switch (DOM.eventGetType(event)) {
       case Event.ONMOUSEDOWN:
           event.stopPropagation();
           break;
       }
}
 
In GWT versions prior to 1.6.4, it would be event.cancelBubble(true).
 

2009/5/5 David Becker <da...@sogeeky.net>
--
Rui Filipe Tavares da Silva

David Becker

unread,
May 6, 2009, 2:03:20 PM5/6/09
to ftr-gwt...@googlegroups.com
Thank you for your suggestion. After following up with a bit of
googling, I've implemented a workaround where I implement a
MouseListener on the Labels (I have two, a title and a description)
contained in my AbstractMonthField descendant that looks like this:

public void onMouseDown(Widget sender, int x, int y) {
DOM.eventCancelBubble(DOM.eventGetCurrentEvent(), true);
}

This works great.

Thank you!
Reply all
Reply to author
Forward
0 new messages