Scope Sub-ControllersThe application main controller creates sub-controllers to control discrete modules. In a main controller, handle a control and then create a subcontroller to handle the functionality:
protected void doHandleControl(Control inControl) throws ControlException {
if (inControl.matchesID(LAUNCH)) {
doLaunch();
} else if (inControl.matchesID(NavTreeView.PATIENTSEARCH)) {
showPatientSearch();
}
protected void showPatientSearch() {
searchcontrol = new PatientSearchController((FoboLauncherView)getView());
this.addChild(searchcontrol);
searchcontrol.startup();
}
|