aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Reply locked New topic
Author

Scroll and Datatable

Ro Ah
Greenhorn

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

Thanks
Ro Ah
Greenhorn

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 …… >
</div>
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

thanks
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: 15665
    
  15

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 http://www.coderanch.com/t/568826/JSF/java/scroll-bar-selectOneMenu

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Scroll and Datatable
 
Similar Threads
Very Different Problem with JScrollPane
Unable to display the contents of portlet in specified width of portlet
Scrolling a JTextPane within a JScrollPane
How to gray out one particular row in JTable
JDialog resize question