AX1609
Using embedded forms
You can use embedded forms to create a form where the display content is sourced from multiple forms. This works as follows:
-
A parent form that contains an Embedded Form component. The parent form can contain other components and otherwise works as normal, except that the Embedded Form component is used to open other child forms within the parent form instance.
- One or more child forms that display within the Embedded Form component. The Embedded Form component can be set up to display a single target child form, or it can be set up to dynamically switch between multiple child forms by using the Menu component. As the user selects items from the menu, the Embedded Form component displays the corresponding child form for that menu item.
When a user views the parent form, the child form displays as "embedded" within the parent, so that both the parent and child forms are displayed within the same browser page and share the same form instance.
Typical embedded form setup
This feature makes it possible to take several individual form files and present them as a single unified "page" to the form user, instead of requiring the form user to navigate between the separate forms. This approach can also simplify form design, by allowing different "screens" or features within a form to be created and maintained within separate files, instead of requiring all aspects of a form to reside within a single file.
NOTE: The typical embedded form design assumes a single Embedded Form component and a Menu component to switch between multiple child forms. Although it is possible to use multiple Embedded Form components to display multiple child forms concurrently, there are some limitations. For more information, see Embedded Form component for Axiom forms.
For example, you may want to create a web-based utility that allows users to perform several different but related actions. Each available action requires different screens, with components and data specific to that action. Instead of building all of the functionality within a single file, you can create different child files for each action, and then create a parent file that provides the overall user interface for selecting the desired action and displaying the relevant child form. Instead of one large, complicated file with many form layers and many sheets of data, you can have several lightweight files that are easier to build, modify, and troubleshoot. The child files can also be reused separately or in different contexts as appropriate.
Other potential use cases for embedded forms include:
-
Form-enabled plan files with multiple screens of information and inputs. The plan file template can provide the overall titles and menu for selecting screens, and then each screen can be sourced from individual utility files in the file group. For more information on this type of plan file design, see Designing plan files with embedded forms.
-
A web-based "driver manager" utility, where the parent file provides a menu for selecting driver files, and then each individual driver file displays as a child form within the parent. Instead of needing to open and review each driver file individually, the user can easily access and edit all drivers as needed.
-
Dashboards with several different screens of charts and other visualizations. Each dashboard screen can be sourced from a separate child form, while the parent form provides the means to switch between these screens. If desired, the individual child files could also be accessed directly for different sets of users who only need to see that particular area or slice of the data.
Use of embedded forms creates a shared form instance, where the parent form and its embedded child forms are managed together by the Axiom Application Server as a related set of forms. If the Embedded Form component is used to display multiple forms (via a Menu component), all of those forms become part of the shared form instance. This shared form instance provides the following benefits:
-
Shared variables: All forms in the shared instance have access to a shared set of variables. You can set a value in one form and then reference that value in all of the other forms within the instance.
-
Persisted child forms: Users can switch between viewing different embedded child forms, and the current state of each child form will be persisted within the shared form instance. All forms in the shared form instance are maintained on the server for the current session, so that as long as the parent form remains open, users can return to the child forms at any time and the state of each child form will be remembered.
-
Shared data cache: All forms in the shared instance use the same GetData cache. If a GetData query is duplicated across multiple forms, after the first query the result can be retrieved from the shared cache instead of initiating another query to the database.