contrib: simple calendar

32 views
Skip to first unread message

gwt.com...@gmail.com

unread,
May 21, 2006, 4:56:05 PM5/21/06
to Google Web Toolkit
Source code published here: http://gwt.components.googlepages.com/

ugotnext

unread,
May 25, 2006, 7:54:11 PM5/25/06
to Google Web Toolkit
1. change

public void onClick(Widget sender) {
....
changeListeners.fireChange(this);
}

to

public void onClick(Widget sender) {
...
if (changeListeners != null){
changeListeners.fireChange(this);
}
}

This currently throws a nullpointerexception, at least in hosted mode,
if no listeners were added to the widget.

2. You might want to change

if (displayNum == today) {
grid.getCellFormatter().addStyleName(i, k, "today");
} else if (displayNum == sameDay) {
grid.getCellFormatter().addStyleName(i, k, "day");
}

to something like

if (displayNum == today) {
grid.getCellFormatter().addStyleName(i, k, "today");
}
if (displayNum == day) {
grid.getCellFormatter().addStyleName(i, k, "day");
}


The way the original code read, I don't believe you can select the
current day becuase the "displayNum == today" would evaluate to true
and never get to evaluate "displayNum == sameDay"


3. Is anyone else working on getting the YUI calendar working with GWT
via JSNI? I'd like to compare notes and ideas.

Regards,
UGotnext

sluramod

unread,
May 25, 2006, 8:50:27 PM5/25/06
to Google Web Toolkit
I'll fix #1, thank you.
About #2, I actually tested the way calendar is rendered, so it should
work correctly.

Alex

bakke...@gmail.com

unread,
May 25, 2006, 9:37:55 PM5/25/06
to Google Web Toolkit
take in account this code is closed source

sluramod

unread,
May 25, 2006, 10:50:36 PM5/25/06
to Google Web Toolkit
Are you nuts? It is under LGPL.

Alex

stefan

unread,
Jun 6, 2006, 2:51:48 AM6/6/06
to Google Web Toolkit
Hi,
I integrated the calendar in a sample application. I got the error
methods getDate(), getYear() ... of class Date are deprecated. What did
I wrong?
Thanks,
Stefan

Jason Essington

unread,
Jun 6, 2006, 10:15:20 AM6/6/06
to Google-We...@googlegroups.com
Stefan

You didn't do anything wrong.

The errors that you received were not really errors, but rather they
were warnings. getDate, getYear, and in fact, most of the other
methods in java.util.Date ARE deprecated, however GWT does not
support the Calendar class (where the replacements for those
deprecated methods live), so to use Dates in GWT, you have to use the
deprecated methods at this time.

Hopefully, Google will implement support for Calendar before Sun
removes the deprecated methods altogether.

-jason

Reply all
Reply to author
Forward
0 new messages