PDA

View Full Version : can't select option in combobox



junkzilla
21 Jul 2008, 11:54 AM
Hi all.
I populated a combobox with a XML file.
The options render ok, but when I try to select one, only the first option gets selected, always.
This is my code.



var vatRecords = Ext.data.Record.create([
{name: 'vatid', type: 'string'}
,{name: 'vat', type: 'float'}
]);

var vat_ds = new Ext.data.Store({
url: '<%= request.getContextPath() %>/remoteadmin/products/vat/index.do'
,reader: new Ext.data.XmlReader({
record: 'row'
},
vatRecords)
});

var combo = new Ext.form.ComboBox({
store: vat_ds
,valueField: 'vatid'
,typeAhead: true
,displayField:'vat'
,mode: 'remote'
,triggerAction: 'all'
,emptyText:'Select vat...'
,selectOnFocus:true
,applyTo: 'vat_cb'
,forceSelection: true
});


Thanks in advanced.
Cheers.

junkzilla
21 Jul 2008, 12:33 PM
My mistake, sorry.
The valueField wasn't 'vatid', it was 'id'.
Thanks anyway.