PDA

View Full Version : Strange Combobox - hiddenname



Asadjan
25 Jun 2010, 5:32 AM
I am getting very strange error in my combobox.

when I submit the data in the form to my php then sometime I don't get the correct values which is integer (hiddenName :'employeeType2') from my combobox but rather the name values from the name (eployeeName).

I have already configured my combox correctly and this happens sometime and most of the time I get the correct employeeId value. This is very strange for me and I am sure I am doing something wrong for which I have no idea what is going on. Please help.

here is the code for my combobox



{
xtype :'combo',
store :cmbEmployee, // defined separately
mode :'remote',
id :'empId_',
fieldLabel :'Eemployee Type',
hiddenName :'employeeType2',
valueField :'employeeId',
displayField :'eployeeName',
typeAhead :true,
triggerAction :'all',
emptyText :'select value',
selectOnFocus :true,
allowBlank :true,
anchor :'95%'
}


cheers,
Asadjan

Condor
25 Jun 2010, 5:47 AM
Just in case, I would add forceSelection:true.

Animal
25 Jun 2010, 7:00 AM
How are the form values loaded? And when?

Asadjan
25 Jun 2010, 7:10 AM
Thank you Condor, It worked.

The form values are loaded when I load the form page (index.php). I call separate .js file which is connected to php file to get the data in the JsonStore store and then populate the combobox. There are 6 comboboxes which are loaded when the form is loaded and they are look up with the same fields,.Id and name. So I use generic function to run the query to get the data for the combobox.

Why am I doing it the wrong way? If you have any better approach then please let me know.

Thanks,

Asad