DateTimeCalender null date [message #1014680] |
Tue, 26 February 2013 09:16 |
|
Hey!
We have a "drop-down" DateTimeCalender implementation in our application. Basically it opens a shell containing a DateTimeCalender plus some more widgets. When closing the shell it applies the values from the calender to a text box. It all works perfect, but in the case when i press ESC to close the shell, this happens:
TypeError: Cannot call method 'getDate' of null
at [object Object]._onChangeDate (http://127.0.0.1:10080/rwt-resources/rap-client.js:66120:31)
at [object Object]._dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:6476:18)
at [object Object].dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:6406:12)
at [object Object].createDispatchChangeEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:6373:14)
at [object Object].setDate (eval at <anonymous> (http://127.0.0.1:10080/rwt-resources/rap-client.js:4511:28))
at [object Object]._onkeypress (http://127.0.0.1:10080/rwt-resources/rap-client.js:62926:20)
at [object Object]._onKeyPress (http://127.0.0.1:10080/rwt-resources/rap-client.js:66134:22)
at [object Object]._dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:6476:18)
at [object Object].dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:6406:12)
at Object._processKeyEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:17290:17)
I know it's kind of foggy to you what we do, but nevertheless: ideas? i had a quick look and can verify that dispose() on the script side is called /after/ this call, so nothing that interferes. Also interesting: /sometimes/ it works, but most of the time it crashes, so timing also seems to matter somehow.
i'm thankful for all pointers, and i will happily debug if i know where.
|
|
|
Re: DateTimeCalender null date [message #1014693 is a reply to message #1014680] |
Tue, 26 February 2013 09:43 |
|
ok, seems this is the "bad" (?) code in rwt.widgets.base.Calender:
case "Escape":
if (this.getDate() != null) {
this.setDate(null);
evt.preventDefault();
evt.stopPropagation();
return true;
}
the this.setDate(null) is the one that causes the exception. i debugged it, and it is obvious what happens. the DateTimeCalendar has a listener _onChangeDate registered which cannot handle null as it directly dereferences the value, and the ESC handler sets to null always -> Boom ideas?
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03026 seconds