• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scroll bar with data table

 
Ven Red
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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>
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • 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
 
V.N.T.Deepak Solasa
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
 
A. Dusi
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put your dataTable inside a h:panelGroup and use the style overflow:auto for the latter.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Venkata
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic