Hi,
I'm having a problem filtering items from a ComboBox when it uses a certain DataSource as its optionDataSource. This DataSource, which is manually created, does not retrieve data from the server but uses cached data instead. When something is typed into the ComboBox, the itens from the pickList are not filtered accordingly to match the typed text.
I'm using the SmartClient version v9.1p_2014-04-20, but this behaviour is also reproducible from the demo pages, on any browser. I wrote a sample code to reproduce the error. I created two ComboBoxes, one which uses a datasource and does not work, and other which uses a valueMap and works.
I'm having a problem filtering items from a ComboBox when it uses a certain DataSource as its optionDataSource. This DataSource, which is manually created, does not retrieve data from the server but uses cached data instead. When something is typed into the ComboBox, the itens from the pickList are not filtered accordingly to match the typed text.
I'm using the SmartClient version v9.1p_2014-04-20, but this behaviour is also reproducible from the demo pages, on any browser. I wrote a sample code to reproduce the error. I created two ComboBoxes, one which uses a datasource and does not work, and other which uses a valueMap and works.
Code:
/*
* Minimal reproduction of comboBox failure to filter it's pickList when using a client datasource.
*/
// Define the data source
var myDataSource = isc.DataSource.create({
cacheData: [
{id: "CA", value: "Canada"},
{id: "UK", value: "United Kingdom"},
{id: "FR", value: "France"},
{id: "IT", value: "Italy"},
{id: "RS", value: "Russia"},
{id: "EU", value: "United States"}
],
clientOnly: true
});
isc.DynamicForm.create({
ID:"testForm",
width: 500,
fields : [
{
ID:"testComboBox", name: "itemName", title: "Item Name", editorType: "comboBox",
optionDataSource: myDataSource,
valueField: "id",
displayField: "value",
filterLocally: true,
addUnknownValues: false,
width: 250,
pickListCellHeight: 50
}]
});
// Define the value Map
var myValueMap = {
"CA": "Canada",
"UK": "United Kingdom",
"FR": "France",
"IT": "Italy",
"RS": "Russia",
"EU": "United States"
};
isc.DynamicForm.create({
ID:"testForm2",
width: 500,
fields : [
{
ID:"testComboBox2", name: "itemName2", title: "Item Name", editorType: "comboBox",
valueMap: myValueMap,
addUnknownValues: false,
width: 250,
pickListCellHeight: 50
}]
});
isc.VLayout.create({
width:"100%",
height:"100%",
members: [testForm, testForm2]
});