View Full Version : combobox submit value issue, DESPERATE for an answer

28 Mar 2011, 12:10 AM
I have a form with combo (hiddenName como).
the form load its data from the server and set the "selectedValue" automatically.
the combo load its value from the server before the form loads its data.
If I click on submit, the display will be sent to the server instead if the value even though i set the hiddenName.
but if i change the combo value, from now and on it will submit the value and not the display, as expected.
Y the initial value that was set by the form prevents the combo to submit its value...?

this is the combo and the store:

var store = new Ext.data.JsonStore({
autoLoad: true,
url: config.url,
root: 'data',
fields:[{name:'userManager_employeeId'},{name:'userManager_userName'}] });

var combo = new Ext.form.ComboBox({
valueField: 'userManager_employeeId',
displayField: 'userManager_userName',
forceSelection: true,
mode: 'remote',
typeAhead: true,
lazyInit :false,
fieldLabel: config.title,
emptyText:'Select a value',

this is the form data:

{"data":[{"employee_employeeId":3,"Affiliate_affiliateId":8,"parent_affiliateId":8,"userManager_employeeId":1,"Affiliate_email":"[email protected]","parent_name":"First Affiliate","userManager":"admin","Affiliate_name":"First Affiliate","user_userName":"admin","user_userId":1}]}

this is the combo data:


this is the form reader:

reader: new Ext.data.JsonReader({
root: 'data',
fields: [{
name: 'userManager'
this is the form data:

I also tried:


if the form data is "admin", I see in the display admin but the submitted value us admin
but if the form data is "1", I see in the display "1" and in the submit value "1" How can i see in the display admin and submit the value ("1") Thanks

28 Mar 2011, 6:10 AM
I dont know but yout reader seems a bit simple and your store contains field

Maybe something like this

var datareader = new Ext.data.JsonReader({id: 'userManager_employeeId', totalProperty: 'total',
root: 'data',
succesProperty: 'success'},
[{name: 'userManager_employeeId', mapping: 'userManager_employeeId', type: 'int'},
{name: 'userManager_userName', mapping: 'userManager_userName', type: 'string'}

var datastore = new Ext.data.Store({id:'datastore',
url: 'yourdataurl.jsn'

var combo = new Ext.app.ComboBox({
displayField: 'userManager_userName',
valueField: 'userManager_employeeId',
mode: 'local',
triggerAction: 'all'

28 Mar 2011, 12:26 PM
Hello, Please check your combo data:

You only have 2 records, and the ID is 3 or 4, not 1, you should set the value of field userManager as 3 or 4 on the form data.

Please try it,


29 Mar 2011, 10:32 PM
Thanks !!!
It was a combination of all of you,
Thanks again.