Weird dataTable pagination with latest version from sources

UI Components for JSF
Post Reply
User avatar
daorte
Posts: 35
Joined: 14 Feb 2012, 18:43
Location: Spain

26 Feb 2015, 20:23

Hi!

I have this weird problem with a paginated dataTable using the latest version from sources, when using the pagination the dataTable just breaks, it is better explained by the images and code:

The View

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>test</title>
</h:head>
<h:body>
	<h:form>
	<p:dataTable var="obj" value="#{testBean.strList}" rows="10" paginator="true" paginatorPosition="bottom">
		<p:column headerText="Column 1">
			<h:outputText value="#{obj}" />
		</p:column>
		
		<p:column headerText="Column 2">
			<h:outputText value="#{obj}" />
		</p:column>
		
		<p:column headerText="Column 3">
			<h:outputText value="#{obj}" />
		</p:column>
		
		<p:column headerText="Column 4">
			<h:outputText value="#{obj}" />
		</p:column>
	</p:dataTable>
	</h:form>
</h:body>
</html>
The ManagedBean

Code: Select all

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;


@Named
@ViewScoped
public class TestBean {

	private List<String> strList;
	
	@PostConstruct
	public void doInitListOfString(){
		setStrList(new ArrayList<String>());
		for (int i=1; i<30; i++){
			getStrList().add("TEST " + i);
		}
	}

	public List<String> getStrList() {
		return strList;
	}

	public void setStrList(List<String> strList) {
		this.strList = strList;
	}
}

The Result

Page 1
Image

Paginated to Page 2

Image

Am i missing some configuration about datatable reflow, responsive or anything? a have a previous version from sources too (can not remember the revision) and does not have this behavior.

Thanks in advance for any help.
Last edited by daorte on 27 Feb 2015, 15:16, edited 1 time in total.
PrimeFaces 5.1
WildFly 8.2

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

27 Feb 2015, 01:05

Small detail: the @named annotation should not be combined with javax.faces.bean.Viewscoped but with javax.faces.view.Viewscoped

User avatar
daorte
Posts: 35
Joined: 14 Feb 2012, 18:43
Location: Spain

27 Feb 2015, 14:03

Oh thank you!
A lazy selection of eclipse "organize imports" :o
PrimeFaces 5.1
WildFly 8.2

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Feb 2015, 17:33

Noted down, will fix it this week, looks like a regression from latest DataTable feature development. Thank you.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests