PDA

View Full Version : AssertionError with DatePicker setValue



ygrenzinger
20 Aug 2010, 1:38 AM
In my code I do this :
myScreen.getDateVirement().getDatePicker().setValue(myData.getDate());

And there is always this error :

10:56:29.817 [ERROR] [com.cie1818.ariane.ihm.Ariane] Uncaught exception escaped
java.lang.AssertionError: Method must be called after the component is rendered
at com.extjs.gxt.ui.client.widget.Component.assertAfterRender(Component.java:1500)
at com.extjs.gxt.ui.client.widget.Component.el(Component.java:411)
at com.extjs.gxt.ui.client.widget.form.DateField$1.handleEvent(DateField.java:149)
at com.extjs.gxt.ui.client.widget.form.DateField$1.handleEvent(DateField.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:462)
at com.extjs.gxt.ui.client.widget.DatePicker.setValue(DatePicker.java:488)
at com.extjs.gxt.ui.client.widget.DatePicker.setValue(DatePicker.java:471)
...........

Is this a bug from GXT or something i'm doing wrongly ?

I'm using version GXT 2.1.1 and GWT 2.0.3

Thanks for your answer.

sven
20 Aug 2010, 1:49 AM
I am not fully sure as you have not posted any testcase, but this should be fixed with GXT 2.2 RC1. Can you test it against this version?

Also you should not set the value on the picker, but on the datefield.

sven
20 Aug 2010, 4:04 AM
http://www.sencha.com/forum/showthread.php?99324-Method-must-be-called-after-the-component-is-rendered&highlight=Datepicker found this with the forum search.

ygrenzinger
20 Aug 2010, 5:00 AM
Ah my fault .. a bit tired :/
You can close/delete this thread.

Thanks