PDA

View Full Version : GXT 1.2.3 TimeField Bindings crash



alacenaire
28 Apr 2009, 7:54 AM
It seems that when you try to bind a model on a timefield the method


public Time findModel(Date date) {
if (!initialized) initList();
DateWrapper w = new DateWrapper();
DateWrapper w2 = new DateWrapper(date);

w = w.clearTime();
w = w.addHours(w2.getHours());
w = w.addMinutes(w2.getMinutes());

long l = w.getTime();

List<Time> times = store.getModels();
...


crash on "store.getModels();" if you don't call "myTimeField.setDateValue(new Date());"

A bit strange no ?

sven
28 Apr 2009, 8:07 AM
Please read the bugforum guidelines. There are many informations missing from your post.

alacenaire
28 Apr 2009, 11:17 PM
Sorry guy,

So the TimeField Binding crash if the TimeField is not set with a date.

- GXT version : 1.2.3
- Host mode & web mode
- Mozilla 3.0.8 ; IE6
- Windows XP

here is the error on firebug :


this$static.com_extjs_gxt_ui_client_widget_form_ComboBox_store is null




Sample Code :


TimeField m_time = new TimeField();
m_time.setFieldLabel("Hour");
m_time.setName("Hour");

// if i don't do that the binding crash
m_time.setDateValue(new Date());

...
TimeFieldBinding mytimefieldbind = new TimeFieldBinding(m_time, m_time.getName());
...

// The properties Hour of the model to bind is type of Date.
// I call bind method and the crash is there
mytimefieldbind.bind(myModel);


Hope it help you,
Thanks

alacenaire
29 Apr 2009, 12:24 AM
I have more info...

The problem is when you set the format of a tilmefield with a null value the bind crash.

m_timeField.setFormat();

sven
29 Apr 2009, 1:20 AM
There are still significant details missing.

What does your myModel look like?