Hi all,
I'm using datatable with paginator. Pagination template has many options. Does it have {JumpToPageDropDown} as in YUI library ? If not, how can I get / implement it ? Currently, I need a page drop-down list to navigate to the remain pages (instead of page link buttons).
Please give me some advice on this issue. My current version of Primefaces is 2.2.1.
Thanks all !
Jump-to-page drop down list on datatable
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
It's not available in 3.x, you can create a feature request. It may be looked in 3.FUTURE if it get user votes.
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Agreed. This would be a nice feature to have, especially after I realized how many pages of data that can be browsed via lazy dataTable in my JSF/PrimeFaces web app. When I see that 181 pages for browsing list of Customers, my first thought was an A .. Z navigation set of buttons. I have yet to implement that, but I surely don't mind implementing that myself, since I already have custom FilterBy and Sort buttons/fields that query the database accordingly. writing this response just reminded me that I'd like to do that. So, thanks!
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
While looking for how to customize/finetune the generated UI of the paginator element in PF 3.0 M4, I found a JumpToPageDropdownRenderer. This can be activated by a {JumpToPageDropdown} in paginatorTemplate attribute. It is however undocumented in 3.0 M4 User Guide, can we assume that this new feature is permanent?
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Thank you BalusC! I just added this to all my p:dataTable pages that reference lazyDataModel, and it works great. I wonder if it is using "page" AJAX event as well. If so, I need to add p:ajax event="page" listener="bean.method" to these same pages to update p:ajaxStatus on my page, because my ajaxStatus is not updated at all when I use the paginator buttons.BalusC wrote:While looking for how to customize/finetune the generated UI of the paginator element in PF 3.0 M4, I found a JumpToPageDropdownRenderer. This can be activated by a {JumpToPageDropdown} in paginatorTemplate attribute. It is however undocumented in 3.0 M4 User Guide, can we assume that this new feature is permanent?
Depending on Optimus.Prime's response to this post/finding, I think we need to create a New Issue on Issue Tracker, and pose your/BalusC's question there to get a sure response from Optimus.Prime just in case he does not see this conversation.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Issue # 3033 (please click URL and star this issue to be fixed)
http://code.google.com/p/primefaces/iss ... il?id=3033
After posting my previous response, I've been testing BalusC's find/discovery, and the following error is the result:
Screen capture 1 of 2: jumped to page # 113
Screen capture 2 of 2: clicked 'A' button that shows all customers that begin with 'A', and the SEVERE error (above) was the result.
bean getter/setter (filter buttons on the page results in filtering the result set via SQL SELECT in DAO or entity Facade object)
xhtml/jsf
What is the best way to get around this SEVERE error? I wonder if I can update (or "reset") the sublist or pageIndex in lazyDataModel on server side when I use/click other filter or page Navigation options on p:dataTable. Hmmm....
http://code.google.com/p/primefaces/iss ... il?id=3033
After posting my previous response, I've been testing BalusC's find/discovery, and the following error is the result:
Code: Select all
INFO: START PHASE RESTORE_VIEW 1
INFO: END PHASE RESTORE_VIEW 1
SEVERE: java.lang.IndexOutOfBoundsException: toIndex = 1126
Screen capture 2 of 2: clicked 'A' button that shows all customers that begin with 'A', and the SEVERE error (above) was the result.
bean getter/setter (filter buttons on the page results in filtering the result set via SQL SELECT in DAO or entity Facade object)
Code: Select all
public LazyDataModel<Customer> getLazyModel() {
try {
/* *** MAY NEED TO REMOVE if (lazyModel == null) *** */
if (lazyModel == null) {
// filter by
if ((filterCustomerId != 0) || filterCustomerName.length() > 0 || filterCustomerNameBeginWith.length() > 0) {
lazyModel = new LazyCustomerDataModel(getFacade().filterBy(filterCustomerId, filterCustomerName,
filterCustomerNameBeginWith, sortBy));
}
// first approach for lazy datatable; filterBy and sortBy columns don't work
else {
lazyModel = new LazyCustomerDataModel(getFacade().findAllSortBy(sortBy));
}
} // lazyModel == null
} catch (Exception e) {
e.printStackTrace();
messages.addFormErrorMsg("Error retrieving list of Customers", (e.getMessage() != null) ? e.getMessage() : "");
}
return lazyModel;
}
public void setLazyModel(LazyDataModel<Customer> lazyModel) {
this.lazyModel = lazyModel;
}
Code: Select all
<p:dataTable id="dt_selectCustomerForOrder" var="customer" value="#{pf_customerController.lazyModel}"
paginator="true" paginatorAlwaysVisible="false" rows="10" rowsPerPageTemplate="10,25,50,100,500,1000"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {JumpToPageDropdown}"
selection="#{pf_customerController.selectedRow}" selectionMode="single">
<p:ajax event="page" update=":@this :@form:_ajax_status"/>
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Solution (for later reference or for anyone interested), see forum post below:
LazyDataModel java.lang.IndexOutOfBoundsException: toIndex =
LazyDataModel java.lang.IndexOutOfBoundsException: toIndex =
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
My bad, we had implemented jumptopagedropdown in M4, RC1 and RC2. PF has too much stuff I can't remember all it seems.
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Cagatay, I completely understand!!! I can NEVER remember code that I've developed in the past; i always have to globally search code unless i'm in that code (too) often. Thanks for the response.optimus.prime wrote:My bad, we had implemented jumptopagedropdown in M4, RC1 and RC2. PF has too much stuff I can't remember all it seems.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Information
-
Who is online
Users browsing this forum: No registered users and 37 guests