Hi guys,
I'm using JET5.0 (upgrading from 4.2).
Today I ran into an issue with oj-collection, which reproduces in JET5.1 too.
I am using a simple Departments REST service created with ADF-BC and hooked it up to cookbook Demo here (--> http://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=crud&demo=table )
I simply changed the self.serviceURL to look to my locally running REST Service.
self.serviceURL = '[http://localhost:7101/coe-hr/rest/1/Departments';](http://localhost:7101/coe-hr/rest/1/Departments';)
After applying the change, the cookbook demo still works and shows data coming from my webservice.
When I click one of the department names, the popup to edit is shown, and when I invoke save (without changing the name) I get the message that no changes are done.
Exactly what is expected.
My next change was to add fetchSize to the oj.collection in order to make sure not all departments are loaded directly to the client and that I can eventually use oj-paging-control.
I added fetchSize 10 as shown below:
self.DeptCollection = oj.Collection.extend({
url: self.serviceURL,
model: self.myDept,
comparator: "DepartmentId",
fetchSize:"10"
});
Now the demo stops working. It will still show the departments, and I am still able invoke the edit popup by clicking department name, but when I invoke save (without changing the name) no message is shown. The log shows the error, which results from the fact that myCollection.get(currentId) returns a pending promise and not the actual data in myModel.
self.updateDeptName = function(event) {
var currentId = self.workingId();
var myCollection = self.DeptCol();
var myModel = myCollection.get(currentId);

I'm a bit confused by this, and I am not sure why this is not working.
Not that only the adding fetchSize to the definition of the collection causes this issue, and it is reproducible with other collections too.
Looks like something fundamental which I don't understand.
Could be my bad, so an explanation would be helpful.
Thanks in advance.