PDA

View Full Version : Timefield text dissapears



flsp
30 Nov 2009, 3:47 AM
Hello!
I've searched for a solution, but nobody seems to have this problem...
The timefield combo appears perfectly, and if I select a field it looks like it's been selected, but when it looses the focus, the selected time dissapears.
Can anybody help me, please?
Thanks!!


var panel= new Ext.Panel({
title: 'Panel',
layout: 'table',
layoutConfig: {
columns: 4
},
items: [{
layout: 'form',
colspan: 2,
items: [{
width:126,
xtype: 'timefield',
minValue: '07:00',
maxValue: '22:00',
increment: 5,
format:'H:i',
fieldLabel: 'Time',
allowBlank:true,
name: 'time'
}]
}]

paulyb263
17 Dec 2009, 9:00 AM
Hey did you manage to find a solution to this, I am having exactly the same problem..

Mike Robinson
17 Dec 2009, 9:27 AM
There are some important and peculiar points here:


When you, say, update a record with JSON, then the host must return all of the field values that were updated. And furthermore, it must return those values in a (string) format which ExtJS will understand. If the value is missing, or it has been returned in a format that ExtJS cannot decode, then the "default value" will silently be substituted ... and this is usually a blank.
To put this problem away for good, I found it necessary to extend the JsonStore component with additional code that checks for, e.g. date-fields and stuffs the necessary hooks and decoders into it. I also had to define a fairly hefty subroutine on the server side (ColdFusion 8) which all of the CRUD-datasource methods could reliably call. Only then, by fully controlling the behavior on both the client and the server side, did the behavior become reliable in-practice.

paulyb263
18 Dec 2009, 1:25 AM
Ahh but in my case I am not pulling any data at all into the TimeField, I am simply rendering the field to a FormPanel. I have also tried rendering this to different panels within my app and I get the same behaviour.


There are some important and peculiar points here:


When you, say, update a record with JSON, then the host must return all of the field values that were updated. And furthermore, it must return those values in a (string) format which ExtJS will understand. If the value is missing, or it has been returned in a format that ExtJS cannot decode, then the "default value" will silently be substituted ... and this is usually a blank.
To put this problem away for good, I found it necessary to extend the JsonStore component with additional code that checks for, e.g. date-fields and stuffs the necessary hooks and decoders into it. I also had to define a fairly hefty subroutine on the server side (ColdFusion 8) which all of the CRUD-datasource methods could reliably call. Only then, by fully controlling the behavior on both the client and the server side, did the behavior become reliable in-practice.