mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 15:18:58 +01:00
Immediately set value, even if the label is not available. Fixes problems with setting then getting the value giving different results.
This commit is contained in:
parent
c2c2c6c672
commit
1182ff70b5
@ -277,13 +277,27 @@ var et2_selectAccount = et2_selectbox.extend(
|
|||||||
else // not available: need to call set_value again, after all arrived from server
|
else // not available: need to call set_value again, after all arrived from server
|
||||||
{
|
{
|
||||||
++num_calls;
|
++num_calls;
|
||||||
|
// Add immediately with value as label, we'll replace later
|
||||||
|
this._appendOptionElement(search[j],search[j]);
|
||||||
this.egw().link_title('home-accounts', search[j], function(name)
|
this.egw().link_title('home-accounts', search[j], function(name)
|
||||||
{
|
{
|
||||||
if (++current_call >= num_calls) // only run last callback
|
if (++current_call >= num_calls) // only run last callback
|
||||||
{
|
{
|
||||||
this.set_value(_value);
|
// Update the label
|
||||||
|
// Options are not indexed, so we must look
|
||||||
|
for(var i = 0; i < this.widget.options.select_options.length; i++)
|
||||||
|
{
|
||||||
|
var opt = this.widget.options.select_options[i];
|
||||||
|
if(opt && opt.value && opt.value == this.unknown)
|
||||||
|
{
|
||||||
|
opt.label = name;
|
||||||
|
this.widget.set_select_options(this.widget.options.select_options);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}, this);
|
}
|
||||||
|
this.widget.set_value(_value);
|
||||||
|
}
|
||||||
|
}, {widget: this, unknown: search[j]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user