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 775427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:17:13+00:00 2026-05-14T19:17:13+00:00

I would like your comments and suggestion on this. I am doing the pagination

  • 0

I would like your comments and suggestion on this. I am doing the pagination for a page in jsf. The datatable is bound to a Backing Bean property through the “binding” attribute. I have 2 boolean variables to determine whether to render ‘Prev’ and ‘Next’ Button – which is displayed below the datatable. When either the ‘Prev’ or ‘Next’ button is clicked, In the backing bean I get the bound dataTable property and through which i get the “first” and “rows” attribute of the datatable and change accordingly. I display 5 rows in the page. Please comment and suggest if there any better ways. btw, I am not interested in any JSF Component libraries but stick to only core html render kit.

public String goNext()
{

    UIData htdbl = getBrowseResultsHTMLDataTable1();

    setShowPrev(true);
    //set Rows "0" or "5"
    if(getDisplayResults().size() - (htdbl.getFirst() +5)>5 )
    {
        htdbl.setRows(5);//display 5 rows
    }else if (getDisplayResults().size() - (htdbl.getFirst() +5)<=5) {
        htdbl.setRows(0);//display all rows (which are less than 5)
        setShowNext(false);
    }
    //set First
    htdbl.setFirst(htdbl.getFirst()+5);
    return "success";
}

public String goPrev()
{

    setShowNext(true);
    UIData htdbl = getBrowseResultsHTMLDataTable1();

    //set First
    htdbl.setFirst(htdbl.getFirst()-5);

    if(htdbl.getFirst()==0)
    {
        setShowPrev(false);
    }

    //set Rows - always display 5
    htdbl.setRows(5);//display 5 rows

    return "success";
}
  • 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-05-14T19:17:14+00:00Added an answer on May 14, 2026 at 7:17 pm

    Please comment and suggest if there any better ways.

    Well, that gives not much to answer on. It’s at least not the way “I” would do, if you’re asking for that. Long story short: Effective datatable paging and sorting. You only need Tomahawk (face it, it has its advantages). But if you’re already on JSF2+Facelets instead of JSF1+JSP, then you can in fact also use ui:repeat and @ViewScoped instead of t:dataList and t:saveState.

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

Sidebar

Related Questions

This seems like a silly question but I would really like your comments and
As I am new to this I would like your advice. So far I
would like your comments. Eg: When user first visit www.testing.com/productdetailpage.asp I will use caching-
I would like your suggestions on how to proceed in making a control panel
I would like your guidance on how to create classes and their relationships (generalization,
I would like your advice about how best to solve my problem. In a
I'm trying to implement an ACL and I would like your opinion about which
I would just like your feedback on something. Basically I have a value called
I would really like your help in knowing the procedure to delete a .3gp
I would like to get your opinion on as how far to go with

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.