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

The Archive Base Latest Questions

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

Can someone please explain to me how paging works in SmartGWT? I see it

  • 0

Can someone please explain to me how paging works in SmartGWT?

I see it working in the showcase, but I just can’t find it documented anywhere. (The information in the javadocs far from sufficient to understand what’s going on.)

I have a ListGrid, and a custom DataSource that interacts with my server.

Let’s say I want to set a page size of 25 records in the ListGrid.

What do I have to do:

  • in the ListGrid?
  • in my custom DataSource (has access to DSRequest and DSResponse objects)?
  • in my server?

What are the parameters sent by the SmartGWT client to the server, and what are the parameters the SmartGWT client expects in return?

  • 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-14T23:13:08+00:00Added an answer on May 14, 2026 at 11:13 pm

    If you’re using Smart GWT LGPL :

    Please read the Javadocs of RestDataSource as it explains this in detail : http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/data/RestDataSource.html

    Also have a look at the RestDataSource sample : http://www.smartclient.com/smartgwt/showcase/#featured_restfulds

    If you’re using Smart GWT EE, then
    1) If you’re using the SQL connector then you have 0 code to write on the server as the Smart GWT server side code take care of wiring databinding with your database table.
    2) If you need mode control over server databinding you can have your own server API’s be called when scrolling (fetch), or insert / update / delete occurs. Have a look at the source of this sample : http://www.smartclient.com/smartgwtee/showcase/#javabeans

    Click on the View Source button and examine the source for the SupplyItemDMI class. Notice how you can obtain the start row, end row parameters of the request.

    // By default, for a DSRequest of type "fetch", a method named "fetch" is invoked.  
    // You can customize this via the <serverObject> declaration.  
    public DSResponse fetch(DSRequest dsRequest)  
        throws Exception {  
       log.info("procesing DMI fetch operation");  
    
        // Fetch a List of matching SupplyItem Beans from some pre-existing Java object model  
        // provided by you, represented by "SupplyItemStore" in this example  
        List matchingItems =  
            SupplyItemStore.findMatchingItems((Long) dsRequest.getFieldValue("itemID"),  
                    (String) dsRequest.getFieldValue("itemName"));  
    
        // this implementation shows data paging (returning only ranges of requested records)  
        long startRow = dsRequest.getStartRow();  
        long endRow = dsRequest.getEndRow();  
    
        long totalRows = matchingItems.size();  
        DSResponse dsResponse = new DSResponse();  
        dsResponse.setTotalRows(totalRows);  
        dsResponse.setStartRow(startRow);  
    
        endRow = Math.min(endRow, totalRows);  
        dsResponse.setEndRow(endRow);  
    
        // trim the data to the requested range of records.  In a real application, the startRow  
        // and endRow would be passed to the ORM layer or to SQL for maximum efficiency.  
        List results;  
        if (totalRows > 0) {  
            results = matchingItems.subList((int) dsResponse.getStartRow(),  
                    (int) dsResponse.getEndRow());  
        } else {  
            results = matchingItems;  
        }  
    
        // just return the List of matching beans  
        dsResponse.setData(results);  
    
        return dsResponse;  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain how Read/Show works.. I cannot find any tutorials on it.
Can someone please explain to me how this responsive approach works? This was done
Can someone please explain how to read the below code to find last column
Can someone please explain simply what thread contention is? I have googled it, but
Can someone please explain, in beginner terms, how operator overloading works? I need to
Can someone please explain or give some resources on how function composition works in
Can someone please explain re-usable structures for me? I was working on making some
Can someone please explain why the following doesn't work works: function displayResults(data) { $(#odNextPage).click(function()
Can someone please explain why ?___SID=U is appearing in some Magento URLs on my
Can someone please explain to me why the hell? When I try to set

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.