Fórum
PrimeFaces Pagination Issue with ManagedBean
Andy Murray, modificado 11 Anos atrás.
PrimeFaces Pagination Issue with ManagedBean
New Member Postagens: 11 Data de Entrada: 09/08/12 Postagens Recentes
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..
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..
Neil Griffin, modificado 11 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Do you have a getLazyModel() method in your MyBean class?
Also, does it work OK as a plain webapp (not as a Liferay portlet)?
Also, does it work OK as a plain webapp (not as a Liferay portlet)?
Andy Murray, modificado 11 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
New Member Postagens: 11 Data de Entrada: 09/08/12 Postagens Recentes
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.
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.
Neil Griffin, modificado 11 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
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, modificado 11 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
New Member Postagens: 11 Data de Entrada: 09/08/12 Postagens Recentes
i found that it works in Mozilla but not in IE.
Konstantin Chudinov, modificado 10 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
Junior Member Postagens: 43 Data de Entrada: 23/04/13 Postagens Recentes
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)
Konstantin Chudinov, modificado 10 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
Junior Member Postagens: 43 Data de Entrada: 23/04/13 Postagens RecentesKonstantin 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
Problem was I forgot <h:form> enclosing tag! Primefaces silently swallow this and nothing works
Vernon Singleton, modificado 10 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
Expert Postagens: 315 Data de Entrada: 14/01/13 Postagens RecentesKonstantin 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
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.
Pierpaolo Cira, modificado 8 Anos atrás.
RE: PrimeFaces Pagination Issue with ManagedBean
Regular Member Postagens: 141 Data de Entrada: 26/02/10 Postagens RecentesKonstantin 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
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... +1