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
Alex
Alex
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