Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
Javascript event listener - wait for page update after event and then execute

I'm working on a web project where on one page, I have a paginated JSF datatable. As a default, it has 12 rows - now when I select another amount, like 20, per dropdown box, more table rows are shown and the dropdown box at the bottom of the table scrolls out of view. I want to scroll it back into view for better user experience.

What I managed was implementing some event listener that gets fired whenever a selection from the dropdown gets chosen:

selector.onchange = updateView;

function updateView(e) {
    var selector = document.getElementById(e.target.id);
    selector.scrollIntoView();
}

However, this happens immediately after selecting something, while it takes a few 100 miliseconds for the table to reload. What's the best way to scroll to the dropdown box only after all rows are loaded properly?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!