File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Scroll and Datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply locked New topic

Scroll and Datatable

Ro Ah

Joined: Aug 14, 2007
Posts: 15
Hi All,
I have a rich faces data table. And I need to add a simple vertical scroll when the number of rows is bigger than 5. But I couldn’t find any way to do this.
So I used a rich faces data scroll "<rich:datascroller ... ". It is working fine but my grid contains a field that takes its value from a drop down list. If I select a value in page 1 then paginate to page 2 then go back to page one the selection is lost.
So can anyone help me in solving one of these problems?
1- Add a vertical scroll to data grid ( Note, I can’t use scrollable data grid), or
2- How to keep the selection while pagination using rich faces scroll

Ro Ah

Joined: Aug 14, 2007
Posts: 15
Ok, I figure it out ,

I was able to add a data scroll by using this tag :
<div style="height:150px ; width:100%; overflow-x:auto; overflow-y:scroll">
<rich:dataTable …… >
Surrounding the data table.

Also use <h:selectOneMenu> instead of <rich:comboBox> if you have a list cell. As the later looked like unattached to the grid while scrolling

Vimal Kumar Venugopal
Ranch Hand

Joined: Aug 20, 2011
Posts: 43

Thank you Ro Ah...

Would you please tell me how to add scroll bar to a <h:selectOneMenu>?

"Value has a Value only if its value is valued!"
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Sorry, Ron. You've resurrected a zombie.

Ro Ah asked/answered that question in 2009. And did it the hard way, BTW, since there's a scrollable extendedDataTable tag in RichFaces.

The problem with asking people 3 years later is that they probably aren't interested any more, and considering the lack of employer/employee loyalty these days, probably don't work in the same place or deal with the same issues anymore.

In any event, he basically did what I recommended in my response to your original query about your problem in the thread at

I'm going to lock this thread, so people won't start responding helter-skelter to both that thread and this one. That gets confusing.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Scroll and Datatable
It's not a secret anymore!