Foren

PrimeFaces Pagination Issue with ManagedBean

Andy Murray, geändert vor 11 Jahren.

PrimeFaces Pagination Issue with ManagedBean

New Member Beiträge: 11 Beitrittsdatum: 09.08.12 Neueste Beiträge
Hi,
Im using paginator feature provided by primefaces
when the page loads im able to see first set of records. But when i click next, the "CurrentPageReport" changes but data doesnt load.

I've a bean like:

@ManagedBean
@ViewScoped
public class MyBean {
List result = null;
public MyBean () {
if(result!=null)
lazyModel = new LazyDataModel(result);
}
------------
------------
-------------
---------------
}
The thing is when i cleick next control doesnt go to bean.


this is my xhtml:
<p:dataTable id="myid" value="#{myBean.lazyModel}" var="acc" resizableColumns="true"
frame="hsides" rules="all" emptyMessage="" scrollable="true" scrollHeight="680" rows="10"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
paginatorPosition="top" paginator="true" lazy="true">
-----
-----
----
</p:dataTable>
I followed the primefaces lazy loading apprioach
Any help pls..
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Do you have a getLazyModel() method in your MyBean class?

Also, does it work OK as a plain webapp (not as a Liferay portlet)?
Andy Murray, geändert vor 11 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

New Member Beiträge: 11 Beitrittsdatum: 09.08.12 Neueste Beiträge
Thanks for reply.

yes i do have this in bean:

public LazyDataModel<MyAccount> getLazyModel() {
return lazyModel;
}

when the page loads for the first time control comes here and also to load() method when we override.
But on clicking next control doesnt go to bean. Is there anything i'm missing here.
I did not try with a normal webapp, im just trying with liferay portlet.
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
If you have time, please try it as a normal webapp. If it works in a normal webapp, then it is likely a problem with Liferay Faces. If not, then it might be an application issue.
Andy Murray, geändert vor 11 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

New Member Beiträge: 11 Beitrittsdatum: 09.08.12 Neueste Beiträge
i found that it works in Mozilla but not in IE.
thumbnail
Konstantin Chudinov, geändert vor 10 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

Junior Member Beiträge: 43 Beitrittsdatum: 23.04.13 Neueste Beiträge
It's very strange. I have the same issue - every ajax event doesn't work for table: PerPage combobox, pagination buttons, etc model receives only old values (stale)
thumbnail
Konstantin Chudinov, geändert vor 10 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

Junior Member Beiträge: 43 Beitrittsdatum: 23.04.13 Neueste Beiträge
Konstantin Chudinov:
It's very strange. I have the same issue - every ajax event doesn't work for table: PerPage combobox, pagination buttons, etc model receives only old values (stale)

Oh, it was most silly post I ever had emoticon
Problem was I forgot <h:form> enclosing tag! Primefaces silently swallow this and nothing works
thumbnail
Vernon Singleton, geändert vor 10 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

Expert Beiträge: 315 Beitrittsdatum: 14.01.13 Neueste Beiträge
Konstantin Chudinov:
Konstantin Chudinov:
It's very strange. I have the same issue - every ajax event doesn't work for table: PerPage combobox, pagination buttons, etc model receives only old values (stale)

Oh, it was most silly post I ever had emoticon
Problem was I forgot <h:form> enclosing tag! Primefaces silently swallow this and nothing works



Thanks for posting both your problem and an explanation of your fix for the problem.
You would be surprised how your "most silly post" turns out to be almost _every_single_person's_issue_ who uses these components.

+1 vote for you.

Keep up the good work.
thumbnail
Pierpaolo Cira, geändert vor 8 Jahren.

RE: PrimeFaces Pagination Issue with ManagedBean

Regular Member Beiträge: 141 Beitrittsdatum: 26.02.10 Neueste Beiträge
Konstantin Chudinov:
Konstantin Chudinov:
It's very strange. I have the same issue - every ajax event doesn't work for table: PerPage combobox, pagination buttons, etc model receives only old values (stale)

Oh, it was most silly post I ever had emoticon
Problem was I forgot <h:form> enclosing tag! Primefaces silently swallow this and nothing works



Old post, I know... but you really saved my day... emoticon +1