Many developers implement their database UI via a multi-page form. It is common to have a form with a few basic pages, and then wanting to include a tab control or similar behavior on one of the pages. To do this you would need to nest pages. For example on page four of your form you would have sub-pages one, two, three and four. If you implement this with just one form, then you would need many pages. Each sub-page of page four of this theoretical situation would need to be its own page. This can be avoided by simulating sub-pages using multiple forms.
You can do this by making the original "form" actually a series of forms, where each page is its own form. Then the "pages" can each have their own sub-pages. Each form in the series would have a set of inherited data and form objects so they appear to be the same form, and then the tabs in the original form would set a CurrentPage variable and use VALIDATE or CANCEL to close the "page" and open another.
Here is an example of how it would work:
- 4 Forms named:
- Each form has a tab control with the variable name mytab_var as shown here:
- One method will be used to open your "form" (which is actually a compilation of forms). That method looks like this:
$win:=Open form window("myform_page1")
`this method, "initAll", initializes the shared variables for "myform"
`this method, "initPage", initiates any page specific variables
- Each "page", which is in actuality a separate form, will have a form method that looks like this:
: (Form event=On Close Box )
- Each tab control object will have an object method that looks like this:
: (Form event=On Clicked )
This way you can have each "page" actually be a separate form, then each "page" can have its own subpages handled as normal for forms and pages.