• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

Layout

Layout creates a border layout that has an auto-sizing 'center pane' surrounded by up to four closable and resizable 'border panes' (north, south, east and west). Layouts can be nested, used for an entire page (full page layout) or for a region of the page (element layout), and have client-side and server-side state management.

Layout Tag Documentation

Layout component for border layout with resizable panes.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
fullPage boolean false true Full page layout mode.
maskPanesEarly boolean false false Mask panes early during init.
options Object false Layout options (object or JSON string).
resizerTip String false Resizer tooltip.
sliderTip String false Slider tooltip.
state String false Serialized layout state for server-side persistence.
stateCookie boolean false false Persist state in cookie.
style String false Inline style of the component.
styleClass String false Style class of the component.
togglerTipClosed String false Tooltip when toggler is closed.
togglerTipOpen String false Tooltip when toggler is open.

LayoutPane Tag Documentation

Layout pane for border layout (north, south, east, west, center).

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
closable boolean false true Whether the pane is closable.
combinedPosition String false center Combined position path (set by renderer).
initClosed boolean false false Pane initially closed.
initHidden boolean false false Pane initially hidden.
maskContents boolean false false Mask pane contents.
maskObjects boolean false false Mask pane objects.
maxHeight String false Maximum pane height.
maxSize String false Maximum pane size.
maxWidth String false Maximum pane width.
minHeight String false Minimum pane height.
minSize String false Minimum pane size.
minWidth String false Minimum pane width.
paneSelector String false Custom pane selector.
position String false center Pane position: north, south, west, east, or center.
resizable boolean false true Whether the pane is resizable.
resizeWhileDragging boolean false false Resize while dragging.
resizerTip String false Resizer tooltip.
size String false Pane size.
slidable boolean false true Whether the pane is slideable.
sliderTip String false Slider tooltip.
spacingClosed int false 6 Spacing when pane is closed.
spacingOpen int false 6 Spacing when pane is open.
styleClassContent String false Style class for the pane content.
styleClassHeader String false Style class for the pane header.
styleContent String false Inline style for the pane content.
styleHeader String false Inline style for the pane header.
togglerTipClosed String false Tooltip when toggler is closed.
togglerTipOpen String false Tooltip when toggler is open.
Tag Documentation Widget Source
Element layout and server-side state management

Setting fullPage="false" creates an element layout. Two element layouts with server-side state management are shown below: resize, open or close panes and switch between the layouts. Both are described by LayoutOptions bound to the options attribute; options can also be set as attributes of pe:layoutPane (the Java model takes precedence).

Left
Center
Full page layout, events and client-side state management

A full page layout with nested panes, the AJAX events open, close and resize and client-side state management (stateCookie="true"). The buttons in the north pane call the widget methods sizePane(), toggle(), close() and open(); nested panes are addressed with _, e.g. sizePane('center_north', 300). The "center" pane itself can not be manipulated. Source: fullPage.xhtml below.

Show full page layout
Layout created by options as tag attributes

The layout is created by options defined as attributes of pe:layoutPane, without a LayoutOptions model. Default tooltips (resize, open, close, slide) are redefined on pe:layout and per pane. Layout panes support a limited set of options compared to LayoutOptions. Source: fullPageAttr.xhtml below.

Show layout created by pane options
Custom content between layout panes

Custom content can be placed between layout panes by putting nested panes in a div with the class ui-layout-content (shown here, the nested panes come from an included page), by the option containerSelector of the child options, or in the header facet of a pane, which stays fixed while the pane content scrolls (shown here with messages). Call the widget method sizeContent(pane) when custom content changes its height. Source: customContent.xhtml and customContentNested.xhtml below.

Show full page layout with custom content
IFrame acting as layout pane (tips to objects within panes)

An iframe can be a direct child of a layout pane. Set maskContents="true" on the pane to avoid resizing issues with iframes (maskObjects="true" for objects such as maps), and consider maskPanesEarly="true" on pe:layout. The style class .ui-layout-mask is made visible in this example. Source: iframe.xhtml below.

Show full page layout with iframe

Layout Options

The layout is described by a model which binds all layout options together: the class LayoutOptions. This way all options of the underlying jQuery layout plugin are available, see the overview of layout options, the layout examples site and the changelog.

Alternatively the mostly used options can be set as tag attributes of pe:layoutPane; no LayoutOptions is needed then, but the possibilities are limited.

The options attribute points to an instance of LayoutOptions or to a JSON string of serialized LayoutOptions. LayoutOptions are always serialized to JSON for the widget; when the layout is built once in an application scoped bean, use toJson() to serialize the options once and pass the string.

Usage


<div class="card">
    <h5>Element layout and server-side state management</h5>
    <p>
        Setting <code>fullPage="false"</code> creates an element layout. Two element layouts with server-side state management
        are shown below: resize, open or close panes and switch between the layouts. Both are described by
        <code>LayoutOptions</code> bound to the <code>options</code> attribute; options can also be set as attributes of
        <code>pe:layoutPane</code> (the Java model takes precedence).
    </p>
    <h:form id="formElementLayout">
        <h:panelGroup id="layoutsContainer">
            <p:commandButton value="Switch between element layouts" actionListener="#{elementLayoutController.toogleLayout}"
                             process="layoutsContainer" update="layoutsContainer" icon="pi pi-external-link"/>

            <h:panelGrid id="layoutsGrid" columns="2" style="margin-top: 15px;" cellpadding="0" cellspacing="0">
                <pe:layout fullPage="false" style="width:450px; height:220px;"
                           options="#{elementLayoutController.layoutOptionsOne}"
                           rendered="#{elementLayoutController.layoutOneShown}"
                           state="#{elementLayoutController.stateOne}">
                    <pe:layoutPane position="west">
                        Left
                    </pe:layoutPane>
                    <pe:layoutPane position="center">
                        Center
                    </pe:layoutPane>
                </pe:layout>

                <pe:layout fullPage="false" style="width:450px; height:220px;"
                           options="#{elementLayoutController.layoutOptionsTwo}"
                           rendered="#{!elementLayoutController.layoutOneShown}"
                           state="#{elementLayoutController.stateTwo}">
                    <pe:layoutPane position="east">
                        <pe:layoutPane position="center">
                            <f:facet name="header">
                                Header East-Center
                            </f:facet>
                            East-Center
                        </pe:layoutPane>
                        <pe:layoutPane position="south">
                            <f:facet name="header">
                                Header East-South
                            </f:facet>
                            East-South
                        </pe:layoutPane>
                    </pe:layoutPane>
                    <pe:layoutPane position="center">
                        Center
                    </pe:layoutPane>
                </pe:layout>
            </h:panelGrid>
        </h:panelGroup>
    </h:form>
</div>

<div class="card">
    <h5>Full page layout, events and client-side state management</h5>
    <p>
        A full page layout with nested panes, the AJAX events <i>open</i>, <i>close</i> and <i>resize</i> and client-side state
        management (<code>stateCookie="true"</code>). The buttons in the north pane call the widget methods
        <code>sizePane()</code>, <code>toggle()</code>, <code>close()</code> and <code>open()</code>; nested panes are addressed
        with <code>_</code>, e.g. <code>sizePane('center_north', 300)</code>. The "center" pane itself can not be manipulated.
        Source: <i>fullPage.xhtml</i> below.
    </p>
    <p:linkButton value="Show full page layout" icon="pi pi-external-link" target="_blank"
                  href="#{request.contextPath}/ui/panel/layout/standalone/fullPage"/>
</div>

<div class="card">
    <h5>Layout created by options as tag attributes</h5>
    <p>
        The layout is created by options defined as attributes of <code>pe:layoutPane</code>, without a <code>LayoutOptions</code>
        model. Default tooltips (resize, open, close, slide) are redefined on <code>pe:layout</code> and per pane. Layout panes
        support a limited set of options compared to <code>LayoutOptions</code>. Source: <i>fullPageAttr.xhtml</i> below.
    </p>
    <p:linkButton value="Show layout created by pane options" icon="pi pi-external-link" target="_blank"
                  href="#{request.contextPath}/ui/panel/layout/standalone/fullPageAttr"/>
</div>

<div class="card">
    <h5>Custom content between layout panes</h5>
    <p>
        Custom content can be placed between layout panes by putting nested panes in a <code>div</code> with the class
        <code>ui-layout-content</code> (shown here, the nested panes come from an included page), by the option
        <code>containerSelector</code> of the child options, or in the <code>header</code> facet of a pane, which stays fixed
        while the pane content scrolls (shown here with messages). Call the widget method <code>sizeContent(pane)</code> when
        custom content changes its height. Source: <i>customContent.xhtml</i> and <i>customContentNested.xhtml</i> below.
    </p>
    <p:linkButton value="Show full page layout with custom content" icon="pi pi-external-link" target="_blank"
                  href="#{request.contextPath}/ui/panel/layout/standalone/customContent"/>
</div>

<div class="card">
    <h5>IFrame acting as layout pane (tips to objects within panes)</h5>
    <p>
        An iframe can be a direct child of a layout pane. Set <code>maskContents="true"</code> on the pane to avoid resizing
        issues with iframes (<code>maskObjects="true"</code> for objects such as maps), and consider
        <code>maskPanesEarly="true"</code> on <code>pe:layout</code>. The style class <code>.ui-layout-mask</code> is made
        visible in this example. Source: <i>iframe.xhtml</i> below.
    </p>
    <p:linkButton value="Show full page layout with iframe" icon="pi pi-external-link" target="_blank"
                  href="#{request.contextPath}/ui/panel/layout/standalone/iframe"/>
</div>