If the records in a PickList are updated (e.g. by forcing a server fetch) each time when it is launched and new record(s) is added in index(es) above the current selection, multiple highlights are shown in the PickList. The incorrect highlight seems to be based on the original selection index (before the new record is added) instead of the index of the current selection.
The fetch is server is forced by overriding getPickListFiterCriteria() as follows:
Problem can be reproduced on a slighty modified SmartClient Dropdown Grid example on http://www.smartclient.com/#dropdownGrid using SmartClient Version: v9.1p_2015-01-08/Pro Deployment (built 2015-01-08) on Firefox 35 and Chrome 39.0 where simulation of new data added by the server is done via overriding dataArrived() for demo purpose:
Steps to reproduce:
1) Open the Item pick list and select the 3rd one from the top with unit cost 0.61 (see Step 1.png)
2) Open the Item pick list again and a new "test" record is added to the top. The record selected in Step 1) is still selected and is now the 4th one from the top. However, the record that is 3rd one from the top in this new pick list is still high-lighted. (see Step 2.png)
3) Open the Item pick list again and a new "test" record is added to the top. The record selected in Step 1) is still selected and is now the 5th one from the top. However, the record that is 3rd one from the top in this new pick list is still high-lighted. (see Step 3.png)
The problem is reproducible on a system where opening the PickList will trigger a server fetch each time. The above code is just for demo purpose only.
The problem is reproducible only if the new record is added above the current selection. It is not reproducible if it is added below the current selection.
----------------
SmartClient Version: v9.1p_2015-01-08/Pro Deployment (built 2015-01-08)
Windows 7 Firefox 34.0.5, 35.0 and Chrome 39.0.2171.99 m
The fetch is server is forced by overriding getPickListFiterCriteria() as follows:
Code:
getPickListFilterCriteria: function() {
return isc.DataSource.combineCriteria(this.Super("getPickListFilterCriteria", arguments), {timestamp: new Date().getTime()});
}Code:
isc.DynamicForm.create({
ID:"exampleForm",
width:300,
fields: [
{
nextItem: -1,
name:"itemID",
type:"select",
width:240,
title:"Item",
optionDataSource:"supplyItem",
valueField:"SKU",
displayField:"itemName",
pickListWidth:450,
pickListFields: [
{ name: "itemName" },
{ name: "units" },
{ name: "unitCost" }
],
getPickListFilterCriteria: function() {
return isc.DataSource.combineCriteria(this.Super("getPickListFilterCriteria", arguments), {timestamp: new Date().getTime()});
},
dataArrived: function() {
for (i=0; i < this.nextItem; i++)
{
this.pickList.addData({itemName: "test" + i, units: "Roll", unitCost: "5.0", itemID: i, SKU: "SKU", category: "U-Tac"});
}
this.nextItem++;
this.Super("dataArrived", arguments);
}
}
]
});1) Open the Item pick list and select the 3rd one from the top with unit cost 0.61 (see Step 1.png)
2) Open the Item pick list again and a new "test" record is added to the top. The record selected in Step 1) is still selected and is now the 4th one from the top. However, the record that is 3rd one from the top in this new pick list is still high-lighted. (see Step 2.png)
3) Open the Item pick list again and a new "test" record is added to the top. The record selected in Step 1) is still selected and is now the 5th one from the top. However, the record that is 3rd one from the top in this new pick list is still high-lighted. (see Step 3.png)
The problem is reproducible on a system where opening the PickList will trigger a server fetch each time. The above code is just for demo purpose only.
The problem is reproducible only if the new record is added above the current selection. It is not reproducible if it is added below the current selection.
----------------
SmartClient Version: v9.1p_2015-01-08/Pro Deployment (built 2015-01-08)
Windows 7 Firefox 34.0.5, 35.0 and Chrome 39.0.2171.99 m