PDA

View Full Version : [OPEN] [CLOSED-570] Ext.form.ComboBox hiddenValue not submited



da_bar
14 Feb 2010, 3:30 PM
Ext version tested:


Ext 3.1.1



Adapter used:


ext



css used:


only default ext-all.css





Browser versions tested against:


FF3.6 (firebug 1.5.0 installed)



Operating System:


WinXP Pro



Description:


Submitting a combobox with preset hiddenValue submits value and not hiddenValue, but according to docuemntation it should submit hiddenValue



Test Case:



Reciepts.grid.getTopToolbar().add(
{
id: 'currencyId-print-reciept',
name: 'currencyId',
store: new Ext.data.ArrayStore({
fields: [
'currency',
'displayText'
],
data: [['hrk', 'HRK'], ['eur', 'EUR'], ['usd', 'USD'], ['gbp', 'GBP']]
}),
displayField: 'displayText',
valueField: 'currency',
hiddenName : 'currency',
hiddenValue: 'usd',
value: 'USD',
typeAhead: true,
forceSelection: true,
mode: 'local',
triggerAction: 'all',
selectOnFocus: true,
editable: true,
xtype: 'combo'
});

Possible fix:


Line 58419

// private
initValue : function(){
Ext.form.ComboBox.superclass.initValue.call(this);

if(this.hiddenField){
//this is the problem this.hiddenField.value = Ext.value(Ext.isDefined(this.hiddenValue) ? this.hiddenValue : this.value, '');
if(Ext.isDefined(this.hiddenValue)) this.setValue(this.hiddenValue);
else this.setValue(this.value);
}
},

Jamie Avins
16 Feb 2010, 4:06 PM
I am not able to duplicate this behavior. With your given example, the initial hiddenValue is correctly set as per the documentation.