PDA

View Full Version : Action.submit and Combobox



migolo
10 Jun 2009, 7:13 PM
Hi there

I have this Combobox inside a FormPanel with api defined with an ext.direct function



{
xtype:'combo',
id:"forma_pago",
fieldLabel: 'Forma de pago',
editable: false,
store: new Ext.data.SimpleStore({
fields: ['opcion1', 'opcion2'],
data: [
['0', 'Efectivo'],
['1', 'Cheque'],
['2', 'Tarjeta'],
['3', 'Traspaso']
]
}),
name: 'forma_pago',
valueField:'opcion1',
displayField: 'opcion2',
typeAhead: true,
mode: 'local',
anchor:'95%',
selectOnFocus:true,
triggerAction: 'all', // Muestra todas las opciones del combobox
emptyText:'Seleccione una forma de pago...'
}
The problem I have is when I submit the Form, is that the value sent by the form is the displayField (opcion2) when the value that must be sent is opcion1. What could be the problem?:-?


Best regards
Miguel González

aconran
13 Jun 2009, 9:39 AM
You forgot to specify a hiddenName in your ComboBox configuration.

migolo
15 Jun 2009, 8:09 AM
yes, it works.

Many thanks!