dlouwers
8 Jun 2010, 4:54 AM
Ext version tested:
Ext 3.2.1
Adapter used:
jquery
css used:
only default ext-all.css
Browser versions tested against:
FF 3.6.3 (firebug 1.5.4 installed)
Safari 4.0.5
Operating System:
OSX 10.6
Description:
When a ComboBox is bound to data that has non-unique field values the selected record is changed to the first record with the same display field value
Test Case:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title id='title'>Title</title>
<!-- ** CSS ** -->
<!-- base library -->
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<!-- overrides to base library -->
<!-- ** Javascript ** -->
<!-- base library -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext-all-debug.js"></script>
<!-- overrides to base library -->
<!-- extensions -->
<!-- page specific -->
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = '../../resources/images/default/s.gif';
Ext.onReady(function(){
var store = new Ext.data.ArrayStore({
storeId: 'testStore',
idIndex: 0,
fields: [
{ name: 'id', type: 'integer' },
{ name: 'name', type: 'string' }
],
data: [
[1, 'Dummy'],
[2, 'Example'],
[3, 'Example'],
[4, 'Dummy 2']
]
});
var formpanel = new Ext.form.FormPanel({
items: [{
xtype: 'combo',
ref: 'myCombo',
store: store,
valueField: 'id',
displayField: 'name',
mode: 'local',
listeners: {
select: function(combo, record, index) {
formpanel.correctValue = formpanel.myCombo.value;
},
scope: this
}
}],
buttons: [{
text: 'Report',
handler: function(button, event) {
alert('value is ' + formpanel.myCombo.value + ' and should be ' + formpanel.correctValue);
}
}]
});
formpanel.render(Ext.getBody());
}); //end onReady
</script>
</head>
<body>
</body>
</html>
Steps to reproduce the problem:
Select the second item titled 'Example' from the combo
Hit the report button
The result that was expected:
"Value is 3 and should be 3"
The result that occurs instead:
"Value is 2 and should be 3"
Debugging already done:
none
Workaround:
Store the combobox value upon selecting and #setValue to this stored value when needed again
Ext 3.2.1
Adapter used:
jquery
css used:
only default ext-all.css
Browser versions tested against:
FF 3.6.3 (firebug 1.5.4 installed)
Safari 4.0.5
Operating System:
OSX 10.6
Description:
When a ComboBox is bound to data that has non-unique field values the selected record is changed to the first record with the same display field value
Test Case:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title id='title'>Title</title>
<!-- ** CSS ** -->
<!-- base library -->
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<!-- overrides to base library -->
<!-- ** Javascript ** -->
<!-- base library -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext-all-debug.js"></script>
<!-- overrides to base library -->
<!-- extensions -->
<!-- page specific -->
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = '../../resources/images/default/s.gif';
Ext.onReady(function(){
var store = new Ext.data.ArrayStore({
storeId: 'testStore',
idIndex: 0,
fields: [
{ name: 'id', type: 'integer' },
{ name: 'name', type: 'string' }
],
data: [
[1, 'Dummy'],
[2, 'Example'],
[3, 'Example'],
[4, 'Dummy 2']
]
});
var formpanel = new Ext.form.FormPanel({
items: [{
xtype: 'combo',
ref: 'myCombo',
store: store,
valueField: 'id',
displayField: 'name',
mode: 'local',
listeners: {
select: function(combo, record, index) {
formpanel.correctValue = formpanel.myCombo.value;
},
scope: this
}
}],
buttons: [{
text: 'Report',
handler: function(button, event) {
alert('value is ' + formpanel.myCombo.value + ' and should be ' + formpanel.correctValue);
}
}]
});
formpanel.render(Ext.getBody());
}); //end onReady
</script>
</head>
<body>
</body>
</html>
Steps to reproduce the problem:
Select the second item titled 'Example' from the combo
Hit the report button
The result that was expected:
"Value is 3 and should be 3"
The result that occurs instead:
"Value is 2 and should be 3"
Debugging already done:
none
Workaround:
Store the combobox value upon selecting and #setValue to this stored value when needed again