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

  • Home
  • SEARCH
  • 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 6678135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:12:24+00:00 2026-05-26T04:12:24+00:00

I have a DataTable . I have added NavigationToolBar at the bottom of it.

  • 0

I have a DataTable. I have added NavigationToolBar at the bottom of it.

When I click on a page number (for example 3) and then click on a link in a cell of the table, it goes to another page. Then I click a link on top which goes back to the first page of the datatable. But I want to go back to the same page I was when I clicked the link in the cell (page 3).

How can I write a piece of code that works like back button of the browser? (something like javascript, history.go(-1))

  • 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-26T04:12:24+00:00Added an answer on May 26, 2026 at 4:12 am

    Assuming you’re returning to the Page with the DataTable with setResponsePage(), you’ll be returning to a new instance of the Page, without information about its state before going clicking the cell link.

    As I see it, you have two ways to handle this situation:

    1. You could pass to the detail page’s constructor all relevant info in order to ‘rebuild state’ in the page with the DataTable in your setResponsePage (in this case maybe the page index would be enough). I’ve used this approach before with a search results page, passing all search criteria to the detail page and passing it back again to the search page in order to perform the same search.

    2. You could also address this by passing a reference to the page with the table to the page you go to with the link, and using a PageLink to link back to the same Page as suggested in this thread in the Wicket Users list, or using it in setResponsePage().

    I’d go for the first option, because passing a Page reference to another page can be dangerous, and you can end up with the whole DataTable page serialized in the detail page, and PageLink has been deprecated. See this discussion in the Wicket Users list for details.

    To elaborate a little, you could use DataTable.getCurrentPage() in your Link.onClick() to pass the current page number to the DetailPage, store it there in an int member, and pass it back to the DataTable Page to use it in DataTable.setCurrentPage():

     public DataTablePage extends Page {
          private DataTable dataTable;
          public void setDataTablePage(int page){
                dataTable.setCurrentPage(page);
          }   
          // .....
         // DataTable cell link onclick
         public void onClick(){
             int pageNumber = dataTable.getCurrentPage();
             DetailPage detailPage = new DetailPage(id, params, pageNumber);
             setResponsePage(page);
         }          
     }
    
     public class DetailPage extends Page {
         int pageNumber;
         public DetailPage(String id, Object params, int pageNumber){
             //...
             this.pageNumber = pageNumber;
             //...
         }
         private void backToTablePage(){
              DataTablePage dataTablePage = new DataTablePage(id, params);
              dataTablePage.setDataTablePage(pageNumber);
              setResponsePage(dataTablePage);
         }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable populated with values from a database. I have another datatable
I have added items in a combo box using datatable and rows. First it
I have a simple HTML table which is bound using knockoutJS. However, I've added
I have a datatable where the columns names are getting added at runtime How
I have a function that returns a datatable, I added a code that will
I have an ASP.NET DataTable which I am populating from another set of ASP:TextBox
I have a dynamic number of data elements that need to be added to
I have small lightswitch application having CreateNewUser Screen. Screen fields comes from Datatable added
I have added two datatable using persistent class in Devexpess XPQuery<me_employee> EmployeeQuery = new
I have input fields and datatable in the same page, in such a way

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.