• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Scroll bar with data table

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

how can i show the scroll bar for a data table , if it has more than 10 rows? I tried using div tag with style attribute defined some thing like below.

<h:panelgrid ....>
<div style="overflow...blah..blah">
<h:datatable .....>
blah...blah
</h:datatable>
</div>

but my page doen' disply the crollbar...ami missing any thing???
</panelgrid>
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is purely a HTML/CSS issue. I would suggest that you save your screen as HTML (complete) and edit it locally and get the scrollbars working.

After that, you can apply back your changes to the JSF page
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
if you can use Richfaces,better you use that in which you have scrollable Data Table tag which makes your work so simpler...

Regards
Deepak
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put your dataTable inside a h:panelGroup and use the style overflow:auto for the latter.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apache MyFaces Tomahawk has a data scroller tag that can be paired with a data datable.

This is a page-by-page scroll. If you're looking for an interactive scroll bar, you'll need some sort of AJAX component, instead.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I tried several combination.

1) surround the datatable with div tag - scroll bar is not displaying, but it takes the amount of specified width above the data table and that part appears blank.

2) surrounding the Panel grid with div tag - displays the scroll bar, but it takes height starting from table header, column headers and then columns,
which is not good. And also it is taking the specified amount of height even there is no record or less records. I tried giving the percentage of height, then scrollbars not coming.

Can some one help me in resolving the issue??

Thanks in advance.

Ven
 
A. Dusi
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you do not want the headers to scroll. In that case you should try separating header and the data into different tables. Use the scrollbar style only for the table showing the data. I remember that this topic was discussed previously in this forum. You may do a search for a better solution.

Also in order to hide the default height of the panelGroup when there are no /less records, you may try two separate panelGroups one with fixed height rendered when there are some specified records and one with no fixed height rendered when there are no/less records.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic