Commit 5e60607f authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update UserDataMultiDefault to fix another bug in setValue.

parent f5d7717e
...@@ -118,15 +118,16 @@ Ext.define('Event.form.field.UserDataMultiDefault', { ...@@ -118,15 +118,16 @@ Ext.define('Event.form.field.UserDataMultiDefault', {
var me = this, var me = this,
combo = me.combo || null, combo = me.combo || null,
form = me.up('xform, form').getForm(), form = me.up('xform, form').getForm(),
cfg, formRecord, rawValue; cfg, formAction, formRecord, rawValue;
// is the form ready // is the form ready
if (!form) { if (!form) {
return; return;
} }
// linked the ComboBox // link the ComboBox
// It is identified by its name, e.g HistororyId_events // It is identified by its name, e.g HistororyId_events
// Attach handler to catch selected value in ComboBox
if (!combo) { if (!combo) {
me.combo = form.findField(me.formFieldIdEvent); me.combo = form.findField(me.formFieldIdEvent);
if (!combo) { if (!combo) {
...@@ -134,8 +135,7 @@ Ext.define('Event.form.field.UserDataMultiDefault', { ...@@ -134,8 +135,7 @@ Ext.define('Event.form.field.UserDataMultiDefault', {
} }
} }
// check if the the select handler activated for the ComboBox if (me.lastKey === undefined) {
if (!combo.hasListener("select")) {
me.combo.on('select', me.onComboBoxSelect, me); me.combo.on('select', me.onComboBoxSelect, me);
} }
...@@ -157,11 +157,12 @@ Ext.define('Event.form.field.UserDataMultiDefault', { ...@@ -157,11 +157,12 @@ Ext.define('Event.form.field.UserDataMultiDefault', {
// form, instead, and extract the selected event. // form, instead, and extract the selected event.
// //
// get the data load in the form // get action and data load in the form
formAction = form.owner.currentAction;
formRecord = form.getRecord(); formRecord = form.getRecord();
// get the selected event and retrieve its configuration // get the event
if (formRecord) { if (formRecord && formAction !== 'create') {
me.lastKey = formRecord.get(me.formFieldIdEvent); me.lastKey = formRecord.get(me.formFieldIdEvent);
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment