View Full Version : [RESOLVED] Combobox : hiddenname, name, valuefield ?

20 Sep 2010, 3:42 AM
Hello !

I've a combobox :

new Ext.form.ComboBox({
displayField: 'display_categorie',
hiddenName: 'nom_categorie',
id: 'idjs_admin_combo_categorie',
listeners: {
select: function() {
var combo_categorie = Ext.getCmp('idjs_admin_combo_categorie');
var id_categorie = combo_categorie.getValue();
failure: function(form, action) {
Ext.Msg.alert("Le chargement des données a échoué.", action.result.errors);
params:{id_categorie: id_categorie},
waitMsg:'Chargement en cours...'
name: 'nom_categorie',
store: categorie_2,

With the store :

var categorie_2 = new Ext.data.JsonStore({
autoDestroy: true,
url: 'htdocs/Commun/categorie.php',
root: 'data_categorie',
storeId: 'store_categorie',
fields: ['display_categorie', 'value_categorie', 'description_categorie']

Some example of the values in the store :
'display_categorie' : 'Bonjour'
'value_categorie' : 1
'description_categorie' : 'Comment allez-vous ?'

All is working fine when i select a value in the combo, it's the valuefield which is posted (id_categorie = combo_categorie.getValue()) and in firebug, i can see this value (ie the store's value_categorie : 1)

But, when the select listeners is ended, i can see in firebug that combo_categorie.getValue() is the displayField value (ie the store's display_categorie : 'Bonjour').

Some idea ?
What did i do wrong ?

30 Sep 2010, 3:51 AM
What's wrong ?

I had two fields with the same name.

I change one name, and all is working fine !