Tobago Demo

Menu

Panel

A <tc:panel/> is a simple content container. In the most cases it's invisible and wrapping other components.

Tag Library Documentation

Basics

The panel has a custom class, which set a blue background color. The class of the panel is set via the <tc:style customClass="blue"/> tag.

<tc:panel> <tc:style customClass="blue"/> ... </tc:panel>

Content of the panel with the blue background.

Reload

Tag Library Documentation

To reload the panel in a dedicated frequency, you can use the <f:facet name="reload"> tag. The content of the panel is an output text, which display the current time.

<tc:panel> <f:facet name="reload"> <tc:reload frequency="1000"/> ... 22:51:15

Reload with update control

With the update attribute the rendering of the panel can be dropped, if there is no need to update the content. In this example, we only display the current time, if the seconds are between 10 - 19, 30 - 39 or 50 - 59.

<tc:panel> <f:facet name="reload"> <tc:reload frequency="1000" update="#{panelController.oddDecaSecond}"/> ... 22:51:15 This reloads the panel directly (only for testing purpuse here).

Ajax

A panel can also be useful if more than one component should be rerendered. A component for rerendering can be set with the render attribute in the <f:ajax/> tag. In this example, 'Outputfield One' and 'Outputfield Two' should be rerendered. To do so, the output fields are wrapped in a panel. After the input field loosing the focus, the given text is shown by the output fields.

© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.