scrollable datatable in layout
Posted: 22 Sep 2011, 16:14
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):
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.
Is there a way to achive the behaviour: scrollable dataTable within a layout where the height of the table can change?
I use a p:dataTable within a p:layoutUnit, where this layout is embedded into another fullPage-layout. Something like (inner layout only):
Code: Select all
<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" >
<p:column>
<f:facet name="header">Name</f:facet>
<h:outputText value="#{destination.name}" />
</p:column>
</p:dataTable>
</p:layoutUnit>
<p:layoutUnit id="edit" position="center" header="lulu" minSize="50">
<h:outputText value="some text" />
</p:layoutUnit>
</p:layout>
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.
Code: Select all
scrollable="true" scrollHeight="200">