What do I need to do to allow posting back changes to the DataController?
I have an EmployeeDataController : DataController. Getting and binding/displaying the data is working fine so far.
But when I try to save changes I am running into problems.
First when Html.UpshotContext(false)
If I override the ExecuteAsync method in my EmployeeDataController it does get called when an item is changed but the ChangeSet is null. None of the other methods I have overridden (PersistChangeSet, Submit etc) are ever called.
Second if Html.UpshotContext(true) and add
self.saveAll = function () { self.dataSource.commitChanges() }
However I am still not getting any call backs. When stepping through I see in the upshot method
_commitChanges
that the options url = "/api/Employee?action=" and the opertationName = GetEmployees (which was defined in
@(Html.UpshotContext(bufferChanges:=true).DataSource(Of EmployeeDataController)(Function(x) x.GetEmployees()))
I am guessing there is someplace to define the operation for the commitChanges but I haven't figured that out yet.
*Edit I have fixed the runtime error I mentioned before.
el_gringo_gr...
Member
2 Points
9 Posts
commitChanges on DataSource using DataController
Mar 27, 2012 04:03 PM|LINK
What do I need to do to allow posting back changes to the DataController?
I have an EmployeeDataController : DataController. Getting and binding/displaying the data is working fine so far.
But when I try to save changes I am running into problems.
First when Html.UpshotContext(false)
If I override the ExecuteAsync method in my EmployeeDataController it does get called when an item is changed but the ChangeSet is null. None of the other methods I have overridden (PersistChangeSet, Submit etc) are ever called.
Second if Html.UpshotContext(true) and add
self.saveAll = function () { self.dataSource.commitChanges() }
However I am still not getting any call backs. When stepping through I see in the upshot method
_commitChanges
that the options url = "/api/Employee?action=" and the opertationName = GetEmployees (which was defined in
@(Html.UpshotContext(bufferChanges:=true).DataSource(Of EmployeeDataController)(Function(x) x.GetEmployees()))
I am guessing there is someplace to define the operation for the commitChanges but I haven't figured that out yet.
*Edit I have fixed the runtime error I mentioned before.