4 Display Your Own Content
If the base app developer inserted a dynamic container on the page and made it extensible, you can use it to a) re-arrange the content already there, or b) add your own components to display in the container.
A dynamic container displays content in individual sections, or logical regions of the page. You define the UI elements or components displayed in each section, and then set the display logic conditions to determine which sections are displayed. Like the rules in a rule set, the conditions are evaluated in order at runtime. In this example, the dynamic container has three sections, each displaying different content:
The base app developer usually defines one or more built-in sections for the container, but you can create your own sections if you want to add components from the Components palette to the page.
Note:
Unlike dynamic tables and forms, a dynamic container is scoped to the page on which it appears, which means it cannot be shared across other pages or app extensions.How Do Cases Work?
The display logic for determining what's displayed in a dynamic container is defined using cases. A case is similar to the layouts used in dynamic forms and tables, but instead of selecting which fields to display, you select which UI elements or components to display. When you define a case, you specify the conditions for the case, and the sections you want displayed in the container when that condition is met. A container can only display one case at a time, so if a case defines three sections, when that case is displayed you’d only see those three sections displayed in the container.
Configure a Dynamic Container
The easiest way to learn how to configure a dynamic container is to examine a real use case. Suppose the base app developer established a default case that doesn't have any sections. At runtime the container will be empty. Now let’s say that you want to display a header and form in the container, but only when the current user is a manager.
Note:
Dynamic forms and dynamic tables cannot be added to dynamic containers at this time.To achieve this, you would:
At runtime, if the first case, Manager, is true—that is, if the current user is indeed a manager—then the two sections will be displayed in the container in the order they are listed in the case. If the user is not a manager, then the default case is used, which in this example is a container with no sections.
Re-Ordering a Container's Content
Besides defining new cases and templates for a container, you can also change the order the templates are displayed in the container. Just use the Move Up and Move Down arrows for the template under Sections:
You can also use the icon to remove a section from a case. Once removed from a particular case, the section is still available to use in other cases for dynamic containers in the page.
Note:
You can't edit the built-in case set by the dependency's developer, but you could duplicate the case and then use the arrows to reorder the sections in the copy.Guidelines for Working with Container Sections
Here are some things to keep in mind while working with container sections:
-
A section you create in an extension is the full width of the container, although the base app developer has more freedom in this respect. That is, while you can't have two sections side-by-side, the container can stretch to any height required to accommodate all the sections you define.
-
In addition to simple components like text fields and images, you can also add more complex components to your sections. For example, you might include fields for displaying data from a service, or a button that starts an action chain in your app extension.
-
Components in a section can access variables and constants, and trigger events to start action chains.
-
When working with sections, sometimes it’s easier to work in the Structure view, which helps you more readily visualize the position of components. You can also drag components within the Structure view to reorganize them.
-
Unlike dynamic tables and forms, a dynamic container is not bound to a specific data resource, so a section can display data from the Oracle Cloud Application resources available in the page.
Add Content From a Custom Object to Your Page
You can add components to a container section to render data from a data resource, for example, if you have created custom child objects in your Oracle Cloud Application. The component might be one provided in the base app, or a standard component available in the Components palette. For example, you can add a List View component to a section in a dynamic container, and then use the component's Quick Start to bind the component to the data source and select the fields displayed by the component. For more on using Quick Starts to bind data, see Add Data to a Table or List in Building Responsive Applications with Visual Builder Studio.
To display data from your Oracle Cloud Application in a list component: