e.g. have 1 guy calling server function creating new entity:
function loaddata() { var vservercontroller = mobilecontroller.servercontroller(); var vjsonrequest = vservercontroller.createjsonrpcrequest(); vjsonrequest.setquerymethod("createsomenewelementbasedontwoids"); vjsonrequest.addparameter("firstid", 1); vjsonrequest.addparameter("secondid", 2); vjsonrequest.setonfinish(callbackonfinish); vservercontroller.addtoqueue(vjsonrequest); } function callbackonfinish() { var vcontroller = mobilecontroller.activecontroller(); vcontroller.showview(screens.somescreen, true); }
so how can refresh screen after call? server return not full set of data new one.
what best approach doing this?
assuming want update displayed data, have 2 options - , propably don't need use callback this
- replace displayed dataset
- update displayed record
- (if had user input or created new entry) merge entries
1: return data server foundset.setdatamode(datamode.replace)
- automatically refresh displayed data. in case working multiple records 1 entity , want update 1 of them, use option 2.
2: return specific record want update without datamode replace. record identified it's key/id elements. can find marked little key symbol in entity editor. make sure key elments , additionaly elements want returned. appconkit automatically merge existing record data , display that.
3: if created new record on device, record have value called client_uuid. if return record server contains both client_uuid , key element, record created on device merged server created record , new record displayed
hope helps!
Comments
Post a Comment