Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:13:42+00:00 2026-06-17T19:13:42+00:00

I have been searching for a while to find a solution for DataTable live

  • 0

I have been searching for a while to find a solution for DataTable live scroll problem after sorting by a column.

First I found that “the columns” should have fixed width:

http://code.google.com/p/primefaces/issues/detail?id=1333

Then I found that scrollRows should be used instead of rows

http://code.google.com/p/primefaces/issues/detail?id=1236

Although I have made those changes, I couldn’t manage to put live scroll after sorting by a column.

Can anyone help me please?

Thanks & Regards.

<p:dataTable  id="simulationProductDtId" emptyMessage="#{msgs.notFoundSimulationDetail}" var="item"
         value="#{SimulationResultProductBean.simulationSummaryDetailList}"
         scrollable="true"
         scrollRows="25"
         scrollHeight="350" 
         liveScroll="true"
          resizableColumns="true" 
         style="border-bottom:1px solid #427CC7; overflow:scroll;position: relative;max-width: 100%;overflow-x: hidden"
         rowStyleClass="#{(SimulationResultProductBean.collapseSuperCode and item.gam) ? 'row' : null}"
          selection="#{SimulationResultProductBean.selectedSimulationDetail}" selectionMode="multiple"
         rowKey="#{item.id}">
          <f:facet name="header">
                                                  ...
          </f:facet>
          <p:column sortBy="#{item.productCode}" width="40"
                          rendered="#{DynamicSimulationTableBean.columnRenderedMap['productCode']}">
                         <f:facet name="header">
                               <h:outputLabel value="#{msgs.code}"/>
                          </f:facet>
                          <h:outputText value="#{item.productCode}" >
                                 <f:convertNumber type="number" integerOnly="true" groupingUsed="false"/>
                         </h:outputText>
           </p:column>

           <p:column sortBy="#{item.productName}" style="width:100px"
                           rendered="#{DynamicSimulationTableBean.columnRenderedMap['productName']}">
                          <f:facet name="header">
                             <h:outputLabel value="#{msgs.description}"/>
                          </f:facet>
           </p:column>
          //Other columns with fixed widths...

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:13:43+00:00Added an answer on June 17, 2026 at 7:13 pm

    I found a LAZY solution with a reminder on the top of the datatable:

        <script> 
        function liveScroll(){
             simulationProductDt. scrollOffset = 25;
         }
        </script>
         <!-- UPDATE scrollOffset value in the liveScroll method when scrollRows is changed!-->
        <p:dataTable  id="simulationProductDtId" emptyMessage="#{msgs.notFoundSimulationDetail}" 
                             scrollable="true" scrollRows="25" scrollHeight="350"  liveScroll="true" 
                            ...other properties
    
    
             <p:ajax  event="sort" update="simulationProductDtId" onstart="liveScroll()" onerror="alert('ERROR!')" />
         </p:dataTable>
    

    Hope this helps to somebody.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching for a while now but can't find a working solution
I have been searching this for quite a while but couldn't find a solution
I have been searching for a solution to this and so far found nothing
I have been searching on the internet for a while now, for a solution
After extensive searching on this matter, I have been unable to find an answer
I've been searching for a while and still can't find a simple solution to
I have been searching for a while now and cant find this. what I
I have been searching for answer for a while but i could not find
I need some help. I have been searching for days trying to find solution
I have been searching for this for quite a while and couldn't find a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.