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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:03:24+00:00 2026-06-03T00:03:24+00:00

I am using Struts 2 and want to include an editable server side paging

  • 0

I am using Struts 2 and want to include an editable server side paging and sorting grid.

I need to sublclass the QueryReadStore to implement the write and notification APIs. I do not want to inlcude server side REST services so i do not want to use JsonRest store. Any idea how this can be done.? What methods do i have to override and exactly how. I have gone through many examples but i am not getting how this can be done exactly.

Also is it possible to just extend the ItemFileWriteStore and just override its methods to include server side pagination? If so then which methods do i need to override. Can i get an example about how this can be done?

  • 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-03T00:03:26+00:00Added an answer on June 3, 2026 at 12:03 am

    Answer is ofc yes 🙂
    But do you really need to subclass ItemFileWriteStore, does it not fit your needs? A short explaination of the .save() follows.

    Clientside does modify / new / delete in the store and in turn those items are marked as dirty. While having dirty items, the store will keep references to those in a has, like so:

    store._pending = { _deletedItems: [], _modifiedItems: [], _newItems: [] };
    

    On call save() each of these should be looped, sending requests to server BUT, this does not happen if neither _saveEverything or _saveCustom is defined. WriteStore simply resets its client-side revert feature and saves in client-memory.
    See source search “save: function”

    Here is my implementation of a simple writeAPI, must be modified to use without its inbuilt validation:
    OoCmS._storeAPI

    In short, follow this boiler, given that you would have a CRUD pattern on server:

    new ItemFileWriteStore( {
        url: 'path/to/c**R**ud',
        _saveCustom: function() {
            for(var i in this._pending._newItems) if(this._pending._deletedItems.hasOwnProperty(i)) {
              item = this._getItemByIdentity(i);
              dxhr.post({ url: 'path/to/**C**rud', contents: { id:i }});
            }
    
            for(i in this._pending._modifiedItems) if(this._pending._deletedItems.hasOwnProperty(i)) {
              item = this._getItemByIdentity(i);
              dxhr.post({ url: 'path/to/cr**U**d', contents: { id:i }});
            }
    
            for(i in this._pending._deletedItems) if(this._pending._deletedItems.hasOwnProperty(i)) {
              item = this._getItemByIdentity(i);
              dxhr.post({ url: 'path/to/cru**D**', contents: { id:i }});
        }
    });
    

    Now; as for paging, ItemFileWriteStore has the pagination in it from its superclass mixins.. You just need to call it with two setups, one being directly on store meaning server should only return a subset – or on a model with query capeabilities where server returns a full set.

    var pageSize = 5,    // lets say 5 items pr request
        currentPage = 2; // note, starting on second page (with *one* being offset)
    store.fetch({
      onComplete: function(itemsReceived) { },
      query: { foo: 'bar*' },               // optional filtering, server gets json urlencoded
      count: pageSize,                      // server gets &count=pageSize
      start: currentPage*pageSize-pageSize  // server gets &start=offsetCalculation
    });
    

    quod erat demonstrandum

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

Sidebar

Related Questions

We are using Struts 2 and want a jQuery Grid showing a list of
I am using Struts 2.1.8.1 . I want to use tags, supplied by struts
I need to upload .dat file from jsp page. I am using struts. I
Am using struts 1.3.8 framework in netbeans 6.9 and I want to update a
I am developing a web application using Struts 1.2.7 I want to print a
i want to do arithmetic operation on jsp . I am using struts tag
I am using struts 1.2.I want to enter the request parameters and action called
I want to start using Struts 2 framework, I download Struts 2.2.3 , and
i'm using struts (form) + validation i just want to ask if can i
I'm using struts 2 <s:form> tag. Now I want use design prepared by our

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.