Theme
afterdark
afternoon
afterwork
aristo
black-tie
blitzer
bluesky
bootstrap
casablanca
cruze
cupertino
dark-hive
delta
dot-luv
eggplant
excite-bike
flick
glass-x
home
hot-sneaks
humanity
le-frog
midnight
mint-choc
omega
overcast
pepper-grinder
redmond
rocket
sam
smoothness
south-street
start
sunny
swanky-purse
trontastic
ui-darkness
ui-lightness
vader
FluidGrid
FluidGrid allows to set up a nice tight grid with items that have variable heights and widths. FluidGrid is a responsive grid. That means, the grid will reflow as the window size changes. Items can have any content: text, images, links, input fields, etc. They can be defined in a static or in a dynamic way as in data iteration components.

This example demonstrates how to design a responsive dynamic grid with input fields. This is similar to the DynaForm component in PrimeFaces Extensions, but the grid is not a fixed table in this case. It is responsive! Try to resize the browser window. Tip: You will achieve a consistent alignment across all field blocks if you place the labels above the input fields.

The attribute type of pe:fluidGridItem should match the corresponding type property of FluidGridItem.
  • Label 1
  • Label 2
  • Label 3
  • Label 1
  • Label 2
  • Label 3
  • Label 1
  • Label 2
  • Label 3
Input values
  • First Label :
  • Second Label : Some default value
  • Third Label :
  • Fourth Label : 2
  • Fifth Label :
  • Sixth Label : Tue Oct 24 00:38:17 CEST 2017
  • Seventh Label :
  • Eighth Label :
  • Ninth Label :
Source
<p:growl autoUpdate="true"/>            
            
<pe:fluidGrid id="fluidGrid" value="#{fluidGridDynaFormController.items}" var="data"
              resizeBound="false" hGutter="20" widgetVar="fluidGridWdgt">
    <pe:fluidGridItem type="input">
        <div class="dynaFormLabel">
            <p:outputLabel for="txt" value="#{data.label}"/>
        </div>
        <p:inputText id="txt" value="#{data.value}" required="#{data.required}"/>
    </pe:fluidGridItem>
    <pe:fluidGridItem type="select" styleClass="select">
        <div class="dynaFormLabel">
            <p:outputLabel for="menu" value="#{data.label}"/>
        </div>
        <p:selectOneMenu id="menu" value="#{data.value}" required="#{data.required}">
            <f:selectItems value="#{data.selectItems}"/>
        </p:selectOneMenu>
    </pe:fluidGridItem>
    <pe:fluidGridItem type="calendar" styleClass="calendar">
        <div class="dynaFormLabel">
            <p:outputLabel for="cal" value="#{data.label}"/>
        </div>
        <p:calendar id="cal" value="#{data.value}" required="#{data.required}" showOn="button"/>
    </pe:fluidGridItem>
</pe:fluidGrid>
            
<p:commandButton value="Submit" style="margin-top: 10px;"
                 process="fluidGrid" update=":mainForm:fluidGrid :mainForm:inputValues"
                 oncomplete="if(!args.validationFailed) {PF('inputValuesWidget').show();}"/>

<p:dialog header="Input values" widgetVar="inputValuesWidget">
    <p:dataList id="inputValues" value="#{fluidGridDynaFormController.items}" var="item"
                style="margin:10px;">
        <h:outputText value="#{item.data.label} : #{item.data.value}" style="margin-right:15px;"/>
    </p:dataList>
</p:dialog>
            
<h:outputStylesheet id="fluidGridCSS">
    .pe-fluidgrid-item {
        width: 160px;
        height: 60px;
    }
    
    .pe-fluidgrid-item input {
        width: 150px;
    }

    .pe-fluidgrid-item.calendar input {
        width: 120px;
    }

    .pe-fluidgrid-item.select .ui-selectonemenu {
        width: 134px !important;
    }
    
    .dynaFormLabel {
        font-weight: bold;
        margin-bottom: 7px;
    }
</h:outputStylesheet>
            
Components and more
Use Cases
Documentation
Attributes (move mouse over the names to see data types)
Name Description
id Unique identifier of the component in a naming container.
rendered Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar Name of the client side widget.
value Collection of items (FluidGridItem) representing model of this component.
var Name of the request-scoped variable for the underlaying object for each iteration.
varContainerId Name of the request-scoped variable which contains the prefix of the client Id within pe:fluidGridItem. This property allows to get the whole clientId of a component within pe:fluidGridItem. The whole client Id is sometimes required for JavaScript or RequestContext.update(...).
style Style of the main container element. Default value is null.
styleClass Style class of the main container element. Default value is null.
hGutter Horizontal space between item elements (interpreted as pixels). Default is 0.
vGutter Vertical space between item elements (interpreted as pixels). Default is 0.
fitWidth Sets the width of the container to fit the available number of columns, based on the size of container's parent element. When enabled, you can center the container with CSS. Note: This option does not work with percentage width of items. Default is false.
originLeft Controls the horizontal flow of the layout. By default, item elements start positioning at the left. Set to false for right-to-left layouts.
originTop Controls the vertical flow of the layout. By default, item elements start positioning at the top. Set to false for bottom-up layouts. It's like Tetris!
resizeBound Binds layout to window resizing. You can bind and unbind resize layout afterwards with the bindResize and unbindResize client-side widget's methods. Default is true.
stamp Specifies which elements are stamped within the layout. These are special layout elements which will not be laid out. Rather, FluidGrid will layout item elements below stamped elements. You can use here every search expressions supported by PrimeFaces Search Expression Framework. Default is null.
transitionDuration Duration of the transition when items change position or appearance, set in a CSS time format. To disable all transitions, set this attribute to null. Default is 0.4s.
hasImages Boolean flag if items contain any images. This can fix overlapping items which are caused by items that change size after a layout due to unloaded media like images. Setting this flag allows to layout all items after they have their proper sizes (images have been loaded). Default value is false.
Events (move mouse over the names to see classes)
Name Description
layoutCompletefired after a layout and all positioning transitions have been completed.
PrimeFaces Extensions Showcase - © 2011-2017, PrimeFaces: 6.1, PrimeFaces Extensions: 6.1.0, JSF: mojarra 2.2.8, Server: jetty/9.4.2.v20170220, Build time: 2017-04-19 16:13
occured!
Message:
Timestamp:
StackTrace:
Developers
Thomas Andraschko andraschko.thomas@gmail.com
Oleg Varaksin ovaraksin@googlemail.com
Nilesh Namdeo Mali nileshmali86@gmail.com
Mauricio Fenoglio fenoglio.mauricio@gmail.com
Pavol Slaný pavol.slany@gmail.com
Sudheer Jonna sudheer.jonna@gmail.com