The Navigation external object allows you to control the visibility and state of targets defined in CallOptions.Target (for Native Mobile applications) and CallOptions.Target for Web.
It does not have any.
Displays the area corresponding to the specified target.
For Web: The behavior depends on the Mode property of the Navigation Style set up in the class of the Form.
- When the Navigation Style Mode is Slide, the target slides into view.
- When the Navigation Style Mode is Static, no changes occur because the area corresponding to the target is always visible when an object is loaded on it.
- When the Navigation Style Mode is Custom, the Hidden Class property is no longer applied.
For Native Mobile: The behavior depends on each Navigation Style implementation. For example, in a Main Menu with Tabs, ShowTarget/HideTarget can show or hide specific tabs. In a Slide Navigation, they open or close the sliding target area.
Note: The Mode property does not apply.
Hides the area corresponding to the specified target. It follows the same logic as the ShowTarget method for Web and Mobile.
The area corresponding to the target specified by the parameter is expanded. The behavior depends on the Mode property of the Navigation Style set up in the Form class.
For Web:
- When the Navigation Style Mode is Slide, the situation is equivalent to invoking the ShowTarget method. If the target was collapsed, it acquires the dimensions specified in the Top Target Height, Right Target Width, Bottom Target Height or Left Target Width property, depending on the target specified.
- When the Navigation Style Mode is Static, there are no changes because the area corresponding to the target is always visible when an object is loaded on it.
- When the Navigation Style Mode is Custom, the situation is equivalent to invoking the ShowTarget method, and the set up specified in the Collapsed Class property of the theme class associated with the target area is no longer applied.
For Native Mobile:
- Expands the target if supported by the current Navigation Style.
- Currently, only the Bottom target in iOS with Slide Navigation supports this method. The goal is to provide generic support for all styles in future versions.
For Web:
Collapses the target according to the Navigation Style Mode set in the Form class.
For Native Mobile:
Collapses the target if supported by the Navigation Style. Currently, this is equivalent to hiding the Bottom target in Slide Navigation for iOS.
Navigation events are triggered when targets are shown, hidden, expanded, or collapsed.
These events apply to both Web and Native Mobile environments.
In iOS, events are currently fired only for the Bottom target in Slide Navigation, but this is a known limitation. In the future, they are expected to be triggered for all supported targets (Left/Right in Slide, Left in Split, Tabs, etc.).
Fired after a target is shown using the ShowTarget method.
Fired after a target is hidden using the HideTarget method, or when a Target is hidden automatically.
Fired after a target is expanded using the ExpandTarget method.
Fired after a target is collapsed using the CollapseTarget method.
- Expand/Collapse methods are available for both Web and Native Mobile environments.
- Navigation events are also available for both environments, with current limitations on iOS (only Bottom in Slide).
- The availability of ShowTarget and HideTarget depends on the Navigation Style. Examples include Right/Bottom for Slide Navigation or tabs in Tabs Navigation (for example: Tab1, Tab2, etc.).
This is a basic example of using the Navigation external object in GeneXus:
Event 'ShowMenu'
Navigation.ShowTarget('Right')
EndEvent
Event Navigation.TargetShown(&Target;) if &Target; = 'Right'
msg('Menu opened') endif
EndEvent
CallOptions Target
CallOptions Target for Web