View Full Version : Combo Submit Problem

18 Nov 2010, 8:57 AM

I have a problem that I cannot solved.
I'm using Ext.form.Combobox in a FormPanel but when I submit the form the value returned by the field is the displayValue.

I declare the combobox in a fieldset, wich is in a AccordionLayout Panel wich is in the FormPanel:

new Ext.form.ComboBox({
fieldLabel: 'Default Priority',
name: 'dirscan_priority',
id: 'optDefPriority',
valueField: 'num',
displayField: 'text',
editable: false,
triggerAction : 'all',
mode: 'local'

Then on the tab panel selection I load the store and choose the appropriate value:

Ext.getCmp('optDefPriority').bindStore(new Ext.data.ArrayStore({fields: ['num','text'],data:data.options.priorities}));

The Json in data.options.priorities look like this:


And I submit the form on the change value event:

Ext.getCmp('optDefPriority').addListener('change', function(field, oldvalue, value){
params: "session=" + session,
waitMsg: 'Saving...',
waitTitle: 'Wait',
success: function(form, action) {
infos("Configuration saved");
failure: function(form, action) {
infos("Error while saving: " + action.result.msg);

Everything else work fine except the comboboxes value...
Any idead?

In the same register I would like that the checkbox return a 0 value and not just a 1 value when they are checked.

I precise that I don't have access to server side code or process.

18 Nov 2010, 9:04 AM
Instead of the name config option, use hiddenName.

18 Nov 2010, 9:34 AM
It was that easy,

Thank you very much, I've been coding in round for the day and was pretty desperate.

Any idea about the checkbox problem?
I'd like them to always be submitted checked or not.