PDA

View Full Version : Problem for get id from comboBox



chuvinha
4 Jan 2011, 5:18 AM
Hi guys, Iam not able to get the id from comboBox.



var fieldTipoArquivoStore = new Ext.data.Store({ [/LEFT]
proxy: new Ext.data.HttpProxy({url: 'resulttipodearquivo.action'}),[/LEFT]
reader: new Ext.data.JsonReader({
root: 'linhas',
fields: [
{name: 'idTipoArquivo'},
{name: 'tipoArquivo'}
]
}),
autoLoad: true
});

var fieldTipoArquivo = new Ext.form.ComboBox( {
id: 'campoTipoArquivo',
fieldLabel : 'Tipo Arquivo',
anchor : '100%',
store: fieldTipoArquivoStore,
displayField:'tipoArquivo',
valueField: 'idTipoArquivo',
name : 'campoTipoArquivo',
editable: false,
forceSelection: true,
triggerAction: 'all',
allowBlank:false,
width: 278,
autoHeight: true,
blankText: "campo obrigatorio"
});[/LEFT]


I put the comboBox's value how idTipoArquivo, but it arrives in the action how disPlayField.
It isn't possible.
The variable's name from Action is campoTipoArquivo.
Could someone help me?

Condor
4 Jan 2011, 5:37 AM
1. Change 'name' to 'hiddenName'.
2. Change the id, because 'hiddenName' and 'id' aren't allowed to be the same.

chuvinha
4 Jan 2011, 6:04 AM
I tested here and it was work =))
Thank's Condor.