Four Js Development Tools Forum

General => Ask Reuben => Topic started by: Reuben B. on July 24, 2020, 05:54:09 am

Title: Ask Reuben 38 - Show Folder Page
Post by: Reuben B. on July 24, 2020, 05:54:09 am
The FOLDER and PAGE containers combine to show the contents of one particular PAGE.  The user can then click on the Page Header to show another particular PAGE.

The key property of a FOLDER and PAGE is that only one PAGE is ever shown at a time, the user is expected to click on the page header or tab to show another page.

The questions we get asked relate to how to control what particular folder page is shown?

The answer to that question is that the front-end will display the Folder Page that contains the field with the focus.  If you programmatically want to change the page shown, do a NEXT FIELD to a field on the page you want to show so that it has the focus, or if you have a singular dialog on each page, in your 4gl switch to that dialog (by implication the field with focus will now be on the desired page)

However there are situations where the dialog might not have a field with focus e.g. MENU, or the field with focus might be outside of the FOLDER.   A method available is to use the ui.Form.ensureElementVisible method to ensure that the page is visible.