Board index JavaServer Faces General scrollable datatable in layout

scrollable datatable in layout

Components, Ajax Framework, Utilities and More.

Post 22 Sep 2011, 16:14

Posts: 5
Hi there!
I use a p:dataTable within a p:layoutUnit, where this layout is embedded into another fullPage-layout. Something like (inner layout only):

<p:layout fullPage="false">
   <p:layoutUnit id="overview" position="north" size="300"
      resizable="true" collapsible="true"
      header="MyHeader" minSize="200">
      <p:dataTable value="#{myController.list}" var="destination" >
            <f:facet name="header">Name</f:facet>
            <h:outputText value="#{}" />
   <p:layoutUnit id="edit" position="center" header="lulu" minSize="50">
      <h:outputText value="some text" />

If the layoutUnit's height gets too small it adds a scrollbar, but the table header is scrolled out of view (as the scroller is not part of the dataTable).

Trying to set scrollable at the dataTable leads to the problem that the scrollHeight has to be set explicitly. As the height changes when the user grabs the layout, it should be dynamically, too.
scrollable="true" scrollHeight="200">

Is there a way to achive the behaviour: scrollable dataTable within a layout where the height of the table can change?
PrimeFaces 3.4.2; jboss eap 6.1; Mojarra 2.1.19; FF, IE

Return to General