Pagination is one common requirement in many projects. But in ADF 11g we have only scrollable facility available. So it becomes quiet tedious job to handle huge data.
First create one Fusion Web Application.
And create the ADF Business Components (I have used Employees Table of HR schema (Oracle XE))
Now create your page. For saving time I have created One ADF Read Only Table by dragging EmployeesView1 from data control to the page.
Now create one managed bean (TestPagebean.java here). I have created the bean in page flow scope.
create the value change listener and action listener.
The valuechange listener code will be like this :
UIXIterator valueIterator = getMyIterator();
Now run the page you will get desired output.
The complete code is below.
Please add in comments for queries..............
First create one Fusion Web Application.
And create the ADF Business Components (I have used Employees Table of HR schema (Oracle XE))
Now create your page. For saving time I have created One ADF Read Only Table by dragging EmployeesView1 from data control to the page.
Now create <af:iterator> where <af:table> tag was present . remove all the table related tags
The complete code is below.
The iterator code is like below:
<af:iterator id="i1"
value="#{bindings.EmployeesView1.collectionModel}"
var="row"
binding="#{pageFlowScope.testPageBean.myIterator}">
Now create one managed bean (TestPagebean.java here). I have created the bean in page flow scope.
create the value change listener and action listener.
The valuechange listener code will be like this :
UIXIterator valueIterator = getMyIterator();
if (!valueChangeEvent.getNewValue().equals(valueChangeEvent.getOldValue())) {
int newPage =
Integer.parseInt(valueChangeEvent.getNewValue().toString());
int pageStart = (newPage) * valueIterator.getRows();
valueIterator.setFirst(pageStart);
AdfFacesContext.getCurrentInstance().addPartialTarget(valueIterator);
Now run the page you will get desired output.
The complete code is below.
Hi,
ReplyDeleteIn case from the database will be taken 5 millions of rows, how will the application or the WLS manage this rows? because I got on 1 million "Out of memory error". Will pagination resolve this problem? Or the 5 millions of row will anyway be taken from database and the server will throw "Out of memory error"?
Thanks
Corneliu
I have not tested with 5 million records but I think it depends on how you design and do the administration.
ReplyDeleteIf you extract the data on demand basis (not all the data at one fetch),do not cache the previous data and configure weblogic server's garbage collection properly then it should solve your problem.
Can you share the code. Please. I like to implement like 1 2 3 4 5..... My email is cnbaluramesh@gmail.com
ReplyDeleteHi,
ReplyDeleteCan you please share the code? would be very usefull for me to see it.
Thank you.
(my email adress is sorina_popa04@yahoo.com)
Hi,
ReplyDeleteIts a very good article.Can you please share the code?
Thank you.
(my email adress is nutantanu@gmail.com)
Hi ,
ReplyDeleteNice. Can you share the code ?
(email is: sohahm_1@yahoo.com)
Thanks.
Hi,
ReplyDeleteCan you share the code?
Thank you.
(my email address is phamduytan2009@gmail.com)
Hi,
ReplyDeleteCan you share the code?
Thank you.
(my email address is krshmathavan@gmail.com)
Hi ,
ReplyDeleteNice. Can you share the code ?
(email is: wwweigh@gmail.com)
Thanks.
Hi,
ReplyDeleteCan you share the code?
Thank you.
tsendee0505@yahoo.com
Hi,
ReplyDeleteCan you share the code?
Thank you.
nadejda.belan@gmail.com
Hi,
ReplyDeleteCan you share the code?
Thank you.
dgajevic@gmail.com
Can you Share the code
ReplyDeleteThanks you.
santhosh.dona@gmail.com
Can you Share the code with me as well?
ReplyDeleteThank you.
chelis.flores@gmail.com
It's kinda hard to understand if there is no code example to referece from??
ReplyDeleteThanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle ADF .
ReplyDeleteActually, I was looking for the same information on internet for
Oracle ADF Interview Questions and Answers/Tips and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject.
Thanks for sharing this blog. The content is beneficial and useful. Very informative post. Visit here to learn more about Data Warehousing companies and Data analytics Companies. I am impressed by the information that you have on this blog. Thanks once more for all the details.Visit here for Top Big Data Companies.
ReplyDelete