Monday, January 25, 2010

ValueChangeEvent in DatePicker

Hi,

I wrapped a DatePicker in a (custom) Popup and I like to hide the
popup when a value is selected in the DatePicker. That's working great
for "new" values, but if I don't change the value but click at the
same, highlighted (and thus already selected) date, no
ValueChangeEvent is fired.

I guess that's desirable most of the time, but not for me :)

To solve this, I had tried to override DatePicker#setValue -- but it's
declared final :(

So I tried to subclass DefaultCalendarView and override onSelected in
its inner class DataCell. But again no luck as DefaultCalendarView is
final...

Ok, last resort, I copied the code of DefaultCalendarView into
MyCalendarView (arrg) -- and it's even worse... Since CellGridImpl is
package-private, I had to move MyCalendarView to
com.google.gwt.user.datepicker.client :(((

I can't tell you how dirty I feel by this "solution" :) Do you have
any idea how to do this w/out duplicating code *and* polluting the
framework's namespace? Of course I could implement my own date picker
(or take any of the open source ones) -- but the existing one is
perfectly fine -- expect for this part...

Sebastian

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate