I am having a problem - SC can’t find an inherited DataSource . The log is below and the relevent code is below that. Can you spot anything obvious? Thanks.
17:28:03.901:INFO:Log:initialized
17:28:05.457:INFO:Log:isc.Page is loaded
17:28:05.703:XRP1:WARN:RPCManager :Can’t find dataSource: isc_DataSource_2 - please make sure that you have a isc_DataSource_2.ds.xml file for it in [webRoot]/shared/ds, response: {operationId: “custom”,
clientContext: undef,
context: Obj,
transactionNum : 0,
httpResponseCode : 200,
httpResponseText : “//isc_RPCResponseStart–>[
{isDSResp…”[254],
xmlHttpRequest: [object XMLHttpRequest],
transport: “xmlHttpRequest”,
status: -1,
clientOnly: undef,
isStructured: true,
callbackArgs: null,
results: Obj,
isDSResponse: true,
invalidateCache: false,
data: “Can’t find dataSource: isc_DataSource_2 …”[133]}
var standDS = isc.DataSource.create({
xmlNamespaces : { sms : "urn:sms.dpstand" },
serviceNamespace: "urn:sms.dpstand",
operationBindings: [
{ operationType: "fetch", wsOperation: "Fill", recordXPath: "//sms:Stand" },
{ operationType: "update", wsOperation: "Update" }
],
fields: [
{ name: "StandId", title: "Stand Id", primaryKey: "true"},
{ name: "StandName", title: "Stand Name"},
{ name: "StandLocation", title: "Stand Location"},
{ name: "AddId", title: "Address Id"},
{ name: "StandPhone", title: "Stand Phone"},
{ name: "StandFax", title: "Stand Fax"},
{ name: "StandEmail", title: "Stand Email"}
],
transformRequest: function(dsRequest){
if (dsRequest.operationType == "fetch") {
var params = {
standId: 0,
standName: ""
};
return isc.addProperties({}, dsRequest.data, params)
}
}});
var ds = isc.DataSource.create({
inheritsFrom: standDS,
fields: [
{ name: "StandId", hidden: true }
]
})
isc.DynamicForm.create({
ID: "standForm",
width: 250
});
standForm.setDataSource(ds);
standForm.fetchData(null, null, { useHttpProxy: true });
The can’t find DataSource warning is probably a red herring - the bigger problem is that your DataSource has no dataURL , serviceNamespace or any other means of contacting a data provider - these are not inherited.
OK, thanks for that. I looked at the following reference and that doesn’t specify dataURL, serviceNamspace etc., Does it behave differently because it uses getSchema()? (just curious).
http://localhost:9090/isomorphic/system/reference/SmartClient_Explorer.html#schemaChaining
loadXMLSchemaReply : function (schemaSet) {
var schemaDS = schemaSet.getSchema("supplyItem");
var ds = isc.DataSource.create({
inheritsFrom:schemaDS,
useParentFieldOrder:true,
fields:[
{name:"itemId", hidden:true, primaryKey:true},
{name:"itemName", title:"item name"},
{name:"nextShipment", useTextField:true, title:"next shipment" }
]
});
listGrid.setDataSource(ds);
dynamicForm.setDataSource(ds);
That example does not attempt to contact the server via the DataSource that inherits the fields.