I want to achieve the following: send some data to the server and upon successful execution, dismiss the current view. What I've done so far:
- Send the data via DataRequest (works)
- Add an onFinish Callback (works)
Try to dimiss the current Viewcontroller in the onFinish (fails) Here is my code
function sendTopic() { var vServerController = mobileController.serverController(); var vJSONRequest = vServerController.createDataRequest(); vJSONRequest.setQueryMethod("createTopic"); vJSONRequest.setOnFinish(finish); vServerController.addToQueue(vJSONRequest); } function finish(vResponse) { if (vResponse.body().search("200")) { //we got a 200 back, everything worked! logger.showMessage("All okay!"); mobileController.activeController().dismissModal(); } }
Any Ideas?