Implementing the back action

The back action is a predefined action dedicated to move back in the stack of windows/forms.

Purpose of the back action

In graphical applications and especially web applications, it is common to see a back button with a left arrow, to move back to the previous window/from.

Genero BDL has a predefined action named "back" which is dedicated to this specific need.

When defining an ON ACTION back action handler, the front-end will automatically display a button on the left of the chromebar (if the chromebar is visible):

Figure: Back button rendering on desktop

Back button rendering on desktop
The back button in the chromebar is considered as default action view, and consequently, no button is displayed in the action frame. However, when the chromebar is hidden, the back button for this action will be created in the action frame.

Controlling the back action

Like regular action views, it is possible to enable/disable the back action:
MENU "test"
    ON ACTION enable
       CALL DIALOG.setActionActive("back",TRUE)
    ON ACTION disable
       CALL DIALOG.setActionActive("back",FALSE)
    ON ACTION back
       MESSAGE "GO BACK!"
END MENU

Like other default action views displayed in the chromebar, the back button is hidden, when the action is disabled.

If needed, like regular default action views, you can control the visibility of the back button with the DEFAULTVIEW attribute.

When using the UNBUFFERED attribute in the input dialog, you can control the field validation with the VALIDATE action attribute. The back action is typically similar to an accept action, not configured with VALIDATE=NO.