Reuse UI Model Elements

The UI DSL allows to use one and the same display or layout within more than one layout (= web page). It also allows to use one and the same display or layout more than once in one and the same layout (= web page). toolbars can be used in more than one layout, display and toolbar. The JSF generators can handle all this to a certain extent. The limitations are documented in this feature description.

Use a display in two different web pages

This kind of reuse is supported. As a matter of fact, the JSF generators do not generate a separate XHTML file for a modeled display. In other words: The reuse only happens on the modeling level. The resulting XHTML content is duplicated and “lives” in the context of the respective web page. A similar rule is applied for DTO classes. There is a separate DTO class generated for a modeled display. When a display is being used in two layouts, then there are two seperate DTO classes generated. So here we also don’t have a reuse mechanism on the code level.

Note

The same rule applies for toolbars that you are going to reuse in different web pages.

Use a display twice in one web page

This kind of reuse is not supported. It would result in name clashes for methods in the managed beans. Your best bet is to copy and paste a display, rename it and use the new display in the same layout.

Note

The same rule applies for toolbars that you use twice in one layout.