I am creating a popup message and show this popup over an action from a button. Now I am trying to dismiss the SplitViewController, on that the popup is shown, from the popup callback. But in my case it fails, so how is the right way to do this?
function showPopUp
{
var popup = vMobileController.solutionController().createPopUp();
popup.setMessage("Testmessage?");
popup.setTitle("test");
popup.addOption("yes",popupYES);
popup.addOption("no",popupNO);
popup.show();
}
function popupNO()
{
var vSolutionController = vMobileController.solutionController();
var vDatamanager = vMobileController.dataManager();
var vLogger = vMobileController.logger();
var currViewC = vSolutionController.rootViewController().firstSubViewControllerByName("overview_split");
currViewC.dismissModal();
}
function popupYES()
{
}
A modal presented controller is never a sub controller of the root view controller. To access modal presented controllers use the accessing methods of the solution controller itself.
var vSolutionController = mobileController.solutionController();
var vControllertoDismiss = vSolutionController.findFirstViewController("overview_split");
if (vControllertoDismiss) {
vControllertoDismiss.dismissModal();
} else {
logger.debug("Coun't find controller overview_split");
}
If this also not find your controller you might misspelled the controllers name? Use Screens.overview_split
to let the ACK autocomplete the screen name.
var vControllertoDismiss = vSolutionController.findFirstViewController(Screens.overview_split);