Hello Isomorphic,
I have a ComboBoxItem which is bound to custom DataSource. Looks like being in the pre-populated field and just pressing Shift or exiting from the field with "Tab" etc mark item as "Pending" and cause unnecessary DataSource Fetch call. This is especially bad when current field display value (what's displayed and what's user is tabbing from) is not processed by server in the way that could be resolved back to the code. See example below. Steps to reproduce:
1. Click onto first field to focus into it
2. Click "Tab"
3. You will see round-trip is made (in "DataSource Log" field below) while no any single change is made
In my case it's really not about inefficiency but rather about not being able to resolve display value back to stored value. Please help!!!
<html>
<!-- =================== Smart Client Loading ======================================= -->
<SCRIPT>window.isomorphicDir = "/SmartClient/"</SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_History.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Core.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Foundation.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Containers.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Grids.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Forms.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_DataBinding.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/skins/Enterprise/load_skin.js"></SCRIPT>
<body onload="initialize()">
<script>
function initialize() {
isc.DataSource.create({
ID: "someDataSource1",
clientOnly: true,
dataProtocol: "clientCustom",
dataFormat: "json",
fields: [{ name: "id" }, {name: "name"}],
cacheData: [
{ id: 1, name: "Item 1" },
{ id: 2, name: "Item 2" },
{ id: 3, name: "Item 3" },
{ id: 4, name: "Item 4" }
],
transformRequest: function(dsRequest) {
var data = dsRequest.data ? JSON.stringify(dsRequest.data) : "--"
var logItem = theForm.getItem("dsLog")
logItem.setValue((logItem.getValue() || "") + "DS1 Request: " + data + "\n")
var dsResponse = {
clientContext: dsRequest.clientContext,
status: 0,
data: this.cacheData
}
var me = this
setTimeout(function() {
me.processResponse(dsRequest.requestId, dsResponse)
}, 0)
}
});
isc.DataSource.create({
ID: "someDataSource2",
clientOnly: true,
dataProtocol: "clientCustom",
dataFormat: "json",
fields: [{ name: "id" }, {name: "name"}],
cacheData: [
{ id: 1, name: "Item 1" },
{ id: 2, name: "Item 2" },
{ id: 3, name: "Item 3" },
{ id: 4, name: "Item 4" }
],
transformRequest: function(dsRequest) {
var data = dsRequest.data ? JSON.stringify(dsRequest.data) : "--"
var logItem = theForm.getItem("dsLog")
logItem.setValue((logItem.getValue() || "") + "DS2 Request: " + data + "\n")
var dsResponse = {
clientContext: dsRequest.clientContext,
status: 0,
data: this.cacheData
}
var me = this
setTimeout(function() {
me.processResponse(dsRequest.requestId, dsResponse)
}, 0)
}
});
var theForm = isc.DynamicForm.create({
values: { x: 3, y: 3 },
items: [
{ name: "theComboBox1", dataPath: "x", editorType: "comboBox", optionDataSource: "someDataSource1", valueField: "id", displayField: "name", minimumSearchLength: 3,
title: "addUnknownValues: false", showPending: true, addUnknownValues: false, cachePickListResults: false, width: 300 },
{ name: "theComboBox2", dataPath: "y", editorType: "comboBox", optionDataSource: "someDataSource2", valueField: "id", displayField: "name",
title: "addUnknownValues: true", showPending: true, width: 300 },
{ name: "dsLog", title: "DataSource log", editorType: "textArea", height: 200, width: 300 }
]
});
}
</script>
</body>
I have a ComboBoxItem which is bound to custom DataSource. Looks like being in the pre-populated field and just pressing Shift or exiting from the field with "Tab" etc mark item as "Pending" and cause unnecessary DataSource Fetch call. This is especially bad when current field display value (what's displayed and what's user is tabbing from) is not processed by server in the way that could be resolved back to the code. See example below. Steps to reproduce:
1. Click onto first field to focus into it
2. Click "Tab"
3. You will see round-trip is made (in "DataSource Log" field below) while no any single change is made
In my case it's really not about inefficiency but rather about not being able to resolve display value back to stored value. Please help!!!
<html>
<!-- =================== Smart Client Loading ======================================= -->
<SCRIPT>window.isomorphicDir = "/SmartClient/"</SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_History.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Core.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Foundation.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Containers.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Grids.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_Forms.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/system/modules/ISC_DataBinding.js"></SCRIPT>
<SCRIPT SRC="/SmartClient/skins/Enterprise/load_skin.js"></SCRIPT>
<body onload="initialize()">
<script>
function initialize() {
isc.DataSource.create({
ID: "someDataSource1",
clientOnly: true,
dataProtocol: "clientCustom",
dataFormat: "json",
fields: [{ name: "id" }, {name: "name"}],
cacheData: [
{ id: 1, name: "Item 1" },
{ id: 2, name: "Item 2" },
{ id: 3, name: "Item 3" },
{ id: 4, name: "Item 4" }
],
transformRequest: function(dsRequest) {
var data = dsRequest.data ? JSON.stringify(dsRequest.data) : "--"
var logItem = theForm.getItem("dsLog")
logItem.setValue((logItem.getValue() || "") + "DS1 Request: " + data + "\n")
var dsResponse = {
clientContext: dsRequest.clientContext,
status: 0,
data: this.cacheData
}
var me = this
setTimeout(function() {
me.processResponse(dsRequest.requestId, dsResponse)
}, 0)
}
});
isc.DataSource.create({
ID: "someDataSource2",
clientOnly: true,
dataProtocol: "clientCustom",
dataFormat: "json",
fields: [{ name: "id" }, {name: "name"}],
cacheData: [
{ id: 1, name: "Item 1" },
{ id: 2, name: "Item 2" },
{ id: 3, name: "Item 3" },
{ id: 4, name: "Item 4" }
],
transformRequest: function(dsRequest) {
var data = dsRequest.data ? JSON.stringify(dsRequest.data) : "--"
var logItem = theForm.getItem("dsLog")
logItem.setValue((logItem.getValue() || "") + "DS2 Request: " + data + "\n")
var dsResponse = {
clientContext: dsRequest.clientContext,
status: 0,
data: this.cacheData
}
var me = this
setTimeout(function() {
me.processResponse(dsRequest.requestId, dsResponse)
}, 0)
}
});
var theForm = isc.DynamicForm.create({
values: { x: 3, y: 3 },
items: [
{ name: "theComboBox1", dataPath: "x", editorType: "comboBox", optionDataSource: "someDataSource1", valueField: "id", displayField: "name", minimumSearchLength: 3,
title: "addUnknownValues: false", showPending: true, addUnknownValues: false, cachePickListResults: false, width: 300 },
{ name: "theComboBox2", dataPath: "y", editorType: "comboBox", optionDataSource: "someDataSource2", valueField: "id", displayField: "name",
title: "addUnknownValues: true", showPending: true, width: 300 },
{ name: "dsLog", title: "DataSource log", editorType: "textArea", height: 200, width: 300 }
]
});
}
</script>
</body>
Comment