Designer 10.5 | webMethods Mobile Development | Creating Business Logic for a Mobile Application | Logic to Transition to Another View
 
Logic to Transition to Another View
Where you add logic to transition from one view to another depends on when you want the application to transition:
*If you want to transition based on a user-initiated event, for example, when a user presses a button in the user interface, you can use the Transition event action object.
When you use the Transition event action object, you do not need to add any code if you simply want to transition to another view. However, if you want to perform actions before or after the transition, you can add custom code. For more information, see Responding to User-Initiated Events.
*If you want to transition back to the previous view when the user presses the Back button, typically you do not need to add logic. The Mobile DevelopmentTransitionStackController provides logic for transitioning to previous views. For more information, see About the TransitionStackController.
The following lists circumstances when you need to add logic to transition back to previous views:
*You disabled the TransitionStackController.
When you disable the TransitionStackController, your application logic must keep track of the views that the application displays and how to transition back.
*You set the Hide Back Button property for the view to true.
When you hide the view’s back button, but have the TransitionStackController enabled, you can use the following code to transition back to a previous view:
getTransitionStackController().popViewController();
*If you want to transition to another view for any other reason, you need to add code to your view to perform the transition.
Unless you take steps to disable the Mobile DevelopmentTransitionStackController, it is enabled and you can use the methods in TransitionStackController.java to transition to the new view. To perform the transition you need to:
*Push the controller for the view to which you are transitioning on the controller stack.
*Transition to the new view.
The following shows sample code to transition to a new view named “MySecondView”.
getTransitionStackController().pushViewController(new
MySecondViewControllerImpl());
The following shows a sample method you can you use to transition from a view named “MasterView” to a view named “DetailsView”. You would place this code in the MasterViewControllerImpl in the src folder.
public void doTransition()
final AbstractViewController target = new DetailsViewController();
getTransitionStackController.pushViewController(target);
}
If you disabled the TransitionStackController, add the logic that you provide to keep track of the view to which you are transitioning and to perform the transition to the new view.
Related Topics