Scrollable DataTable inside Layout

UI Components for JSF
Post Reply
picanha
Posts: 9
Joined: 24 Apr 2010, 11:51

24 Nov 2010, 18:58

Hi,

I'm upgrading from primefaces 2.1 to 2.2RC2 and its going just fine.

Now i'm trying the scrollable datatable, and have a problem rendering it inside the p:layout.
Tried a simple example, and seems that scrollable datatable is using total browser dimensions to calculate table height and width. This is the behavior:



- With paginator everything is working well.
- After rendered, doing a parcial update, scrollable datatable resizes ok.
- If resize browser window, scrollable datatable mantains dimensions. With paginator, it resizes.

Is it an issue? Should i use some css?

Here is the code:

The Template
----------------
...
<h:body>
<f:view contentType="text/html">
<p:layout id="laytou-main" fullPage="true">
...
<p:layoutUnit id="layout-center" position="center" scrollable="true" style="padding: 20px">
<ui:insert name="content">...</ui:insert>
</p:layoutUnit>

</p:layout>
</f:view>
</h:body>

The composition
-------------------
...
<ui:define name="content">
<h:form>
<p:commandButton value="Update first table" update="myTable"/>
<p:dataTable id="myTable" var="myItem" value="#{dtController.myList}" scrollable="true" height="150">
<p:column>
<f:facet name="header">
<h:outputText value="Model" />
</f:facet>
<h:outputText value="#{myItem}" />
</p:column>
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>


Regards,
Picanha
Netbeans 7.2, Glassfish 3.2.1, PrimeFaces 3.4

User avatar
Daedalus
Posts: 164
Joined: 28 Jan 2010, 12:03

24 Nov 2010, 19:29

I can confirm this. It is really annoying that the scrollable Table behaves completely different as a "normal table".

However there is an ugly workaround for this issue. After the resize of the browser window do an ajax update on the table. After the table is updatet is resizes to the correct dimensions. (Like the "normal" Table would without the ajax update)
PrimeFaces 3.0, Glassfish 3.1.2, Mojarra 2.1.6,

picanha
Posts: 9
Joined: 24 Apr 2010, 11:51

24 Nov 2010, 19:39

Hi Daedalus,

Thanks for the reply.

Yes is a possible workaround. And yes, is not beautiful :twisted:
Hope it will be fixed.

regards,
Picanha
Netbeans 7.2, Glassfish 3.2.1, PrimeFaces 3.4

picanha
Posts: 9
Joined: 24 Apr 2010, 11:51

24 Nov 2010, 20:18

Another way, if possible, is to work with fixed width (as my problem is only the table width).
But in this case there are a minor problem. The columns are not aligned with the headers, until one parcial update is made.
Netbeans 7.2, Glassfish 3.2.1, PrimeFaces 3.4

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests