PDA

View Full Version : [SOLVED]sometimes the render listener of a DateField isn't fired



flamant
3 Jun 2011, 12:41 AM
Hi,
I implemented a DateField with a render listener which is not fired sometimes.
The hierarchy is the following

Viewport
- Panel
- Panel
- TabPanel
- FormPanel
- TabPanel
- Panel
- DateField

The DateField is the following :


result = new Ext.form.DateField({
id: "I" + fieldId,
name: "I" + fieldId,
fieldName: field.fldName,
hideLabel: true,
allowBlank: allowBlank,
defaultAllowBlank : (field.fldMode == 'M' ? false : true),
fldMode: field.fldMode,
fldDp: field.fldDp,
fldMc: field.fldMc,
helpText: field.fldText,
style: buildStyle(field.bold, field.fontSize, field.textColor, field.align, field.italic, dataChanged),
cls: (readOnly ? 'readonly' : reservedToSpecificRole ? 'writeRole' : ''),
format: 'dMY',
defaultFormat : 'dMY',
altFormats: 'dMY|MY|Y',
x: powerBuilderXUnitsToPixels(field.fldX) + gridLeftMargin,
y: powerBuilderYUnitsToPixels(field.fldY),
width: powerBuilderXUnitsToPixels(field.fldLength) + 30,
height: powerBuilderYUnitsToPixels(field.fldHeight) - 5,
hidden: (field.fldMode == 'I' ? true : (field.visibility == false ? true : false)),
defaultValue: defaultValue,
hideTrigger: true,
rowId: rowId,
rowSeq: rowSeq,
dtStrict: dtStrict,
defaultDtStrict : field.dtStrict,
dtPast: dtPast,
defaultDtPast : field.dtPast,
readOnly: readOnly,
screenSequence: screenSequence,
subjectId: subjectId,
fieldId: field.fldId,
fldMode: field.fldMode,
fieldType: field.fldType,
initData: null,
disabled: disabled,
screenId: screenId,
sptNbr: sptNbr,
invDeaField: invDeaField,
maskRe: regex,
dataChanged: false,
enableKeyEvents: true,
tabIndex: field.fldTabIndex,
validator: function (val) {
var field = this;
return validDate(val, field);
},
listeners: {
change: function(field, newValue, oldValue) {
setDateRawValue(field);
dataChanged = true;
this.dataChanged = true;
if (this.initData != null) {
plainInitDataChanged = true;
}
resetConstraint(field, this.rowId);
resetDatPenMisCon(field, false);
updateGridVisibility(field);
updateFieldVisibility(field);
},
render: function(dateField) {
applyKeyMapToField(dateField);
var elt = dateField.getEl();
elt.field = dateField;
elt.on('dblclick', function(evt, elRef) {
var field = this.field;
if (!field.readOnly) {
field.onTriggerClick();
}
})
}
}
});
Thank you in davance for your answers

flamant
3 Jun 2011, 3:42 AM
Hi I found what was wrong.

For the need of tha application I had to make a suspendEvents() on the field so that render event wasn't fired

Thank you anyway to having read my post