Primefaces autocomplete is very slow to load large data in JSF page - jsf

I'm trying to implement autocomplete search using 'Primefaces Autocomplete' tag for morethan one lack options to show. When I enter a character in the autocomplete box,which is having 30000 options, it is taking more than 40 seconds to update the options in the autocomplete box and the screen is getting struck until the list is updated. In the server side it's taking 15 milliseconds to iterate but when returning to the Jsf page , it's taking more time. Please assist me on this. Thanks in advance.

Related

Primefaces performance when having a lot of Buttons [duplicate]

I am trying to generate a table dynamically using HtmlDataTable in JSF. When I am giving the number of rows and columns greater than 25 each, some of the cells are not getting populated only in IE and it's getting very slow. However, I can see the value when debugging the code using Firebug. It is working fine in Firefox and Chrome.
How is this caused and how can I solve it?
Internet Explorer is known to have an extremely poor table renderer. Especially when the columns and table nesting goes overzealous.
There's no other solution than making your table smaller by introducing lazy loading and pagination so that only 10~100 rows will be displayed at once. Add if necessary search filters. Additional benefit is that it's also much more user friendly. Google for example also doesn't show all the zillion website links in a monster table without filtering and pagination.
If you happen to use PrimeFaces, use <p:dataTable> with LazyDataModel.
See also:
Efficient JSF Pagination
Update as per the comments, there is not really other alternative if you can't change your server side code. Your best bet is probably to inform the enduser that s/he should be using a real browser instead.
E.g.
<script>
var ie = /*#cc_on!#*/false;
if (ie) {
window.location = 'some_page_which_recommends_different_browser.xhtml';
}
</script>

Displaying a list like a p:selectOneMenu in a page wise manner

I'm trying to manage a <p:selectOneMenu> drop-down to show a list of 12000 records; I'm searching for a smart component within "paginate" my results and dynamic load on scrolling.
Can someone help me?
I'm using Primefaces 3.5
Thanks
Davide

Primefaces Datatable Selection Large Dataset

My application is using:
WildFly 8.2
Mojarra 2.2.8-jbossorg-1 (the one that comes with WildFly).
Primefaces 5.2
JDK8
There's a page where I need to load many files (around 12k) and then show their names to the user so he/she can choose which ones they want to pick up.
And I'm able to show my datatable with the files as expected.
The problem starts when I select more than 1k rows and try to go to the next page of the datatable.
It gets incredibly slow.
I use multiple selection with checkboxes, and from what I saw every time I change the page it sends every checkbox as a parameter from the request.
I really have no idea of how to solve this. Hope someone might help with any suggestion.
Thanks

xPages dataTable page

I have a data table on my xPage that shows e.g. 10 rows (repeat limit, rows="10").
How do I know what's the current page number when I navigate through the records by using pager?
After switching between pages I'd like to return back and open dataTable exactly on same page I left:
getComponent("dataTable1").gotoPage(<page number I save>)
I think the best route to get the behavior you want is to use the <xe:pagerSaveState/> control from the ExtLib, which does the job of storing the state of a given pager and restoring it when you go back to the page. Brad Balassaitis has an example of how to use it here: http://xcellerant.net/2013/08/08/xpages-data-views-6-pager-save-state-control/

Infinite List (Pattern) with JSF/Richfaces (mobile web app)

I am currently introducing a mobile friendly version of our web-application.
In a first step I transformed a rich:dataTable with a lot of columns into a rich:dataList containing only a few columns as values.
The old table used pagination and I want to reuse this existing mechanism to some extend in the new list. In the new list, however, I don't want to paginate but append! So when I click on a "Load More" button, I want to append the new elements to the already existing ones.
However appending should not happen on the server side, but on the client side. Because the normal mechanism is to append elements on the backing bean's list on "Load More" and then trigger some reRendering (e.g. via ). The result of this, is that the old data is fetched from the server again, which I don't want. I just want the new data, which is the next pagination, to be appended to the already existing ones.
Does someone has an idea, how I can realize that?
(limiting factors: JSF 1.X and Richfaces 3.X [in combination with jQuery mobile])
An list pagination example (it's primefaces, cause I couldn't find a richface example): http://www.primefaces.org/showcase/ui/dataListAjax.jsf And something like this I want to transform into an infinite list with a "Load More" button.
Would really appreciate your help and/or ideas about that!
Thanks in advance!
Just in case somebody else is interested in this...
I found a solution or rather a workaround:
I introduced another rich:dataList, that gets rerendered every time I click on "Load More".
The "Load More" button is a "a4j:commandButton" and its action triggers pagination. Finally I use its oncomplete-attribute to call a JavaScript function, that moves the next pagination (temporary list) to my main list via jQuery DOM manipulation.
It works just fine

Resources