DISQUS

Adrian Smith's Blog: How to Create a Remote Paging Listview Using GWT-Ext

  • myio · 1 year ago
    Thanks for the great tutorial. I want to use the Grouping Grid in my application. My data set is pretty large (around 7000 rows). This amount of data seems to be way too much to transmit/display all at once. I was trying to think of how I could use the model you have demonstrated with the tree-like functionality of the Grouping view. It seems like I have to split the work into at least two pieces: collecting and presenting data for the initial collapsed tree; and secondly collecting and presenting the data as each node in the tree is expanded.

    Is there a better way? Can you recommend an approach? Is this even possible since the root/first level of the tree looks different from a data perspective (i.e. fewer columns than an expanded node showing record details).

    Any advice would be appreciated.
  • Adrian · 1 year ago
    Hi myio,

    It's difficult to say what the best approach is without understanding your data and how it would be best presented. With 7000 rows of data I'd say you're on the right track with remote paging.

    The Grouping Grid looks pretty similar to the standard Grid. From looking at the example here (http://www.gwt-ext.com/demo/#gridGrouping) the only difference is that you use a GroupingStore, a GroupingView and call grid.setAutoExpandColumn() on the GridPanel.
  • Pablo · 1 year ago
    Great howto. I found it extremely useful, since RPC serialization would just explode for > 700 of the entities I am working with.
  • Prakash · 1 year ago
    Hi Adrian,
    Thanks for the nice article. I'm trying out something like this. I have a search criteria and when I click the submit button I need to load the store. I can see on the server side, the data is being generated and response is sent. But on the client side, the grid is not getting refreshed. I've posted the problem with code snippets here http://gwt-ext.com/forum/viewtopic.php?f=2&...

    If possible, do let me know if you sense any problem somewhere.

    regards
    Prakash
  • Van · 1 year ago
    Hi,
    Thank you for the great tutorial. I do need some help and guidance for the following issue -- The code works perfectly fine when run in hosted mode, however when I run it in web mode, I do not see any data in the grid. I do not get any exceptions either. I tried all possible ways/options and couldn't proceed further. Can you please guide me. Thanks a lot.
  • Angus · 1 year ago
    I'm getting everything but the data being displayed too. The data is returned to the client and is nicely displayed in Firebug, but no sign of it in the GridPanel. Any suggestions anyone?
  • meeting rooms heathrow · 1 year ago
    Great piece of codes to work with.I'm getting everything but the data being displayed too. The data is returned to the client and is nicely displayed in Firebug, but no sign of it in the GridPanel. Will this not change with new platforms enforced?
  • belgamo · 12 months ago
    Hi, very good code.

    I just have one doubt. I follow the steps and my json is like it:

    {
    "accounts": [
    com.microcpd.mapp.server.Account@13b9fae,
    com.microcpd.mapp.server.Account@1706da8,
    com.microcpd.mapp.server.Account@2f356f],
    "totalCounts": 3}

    Why are not showing the attributes of the Account, it's showing the object.

    Thanks a lot
  • Adrian Smith · 12 months ago
    Could it be that your Account object isn't a javabean (with getters for each attribute)?
  • belgamo · 12 months ago
    Unfortunately i put all the getters and setters methods. Do you have another idea about this problem? Maybe i am doing a mistake and i didn't notice.

    I notice the following:

    JSONArray jsonPersons = new JSONArray(persons, true);

    I don't have the constructor method JSONArray with a parameter boolean like you code. In my code is:

    JSONArray jsonAccounts= new JSONArray(accounts);


    Other observation:

    How is inserted the attribute class in JSON:

    {
    "class": "class com._17od.servlets.Person",
    "dateOfBirth": "2001-05-19",
    "firstname": "Rebecca",
    "id": 5,
    "lastname": "Taylor"
    }



    Thanks a lot
  • rpelluru · 7 months ago
    Hi,
    I tried above example , in my data base i have 21 records.But it's displaying only 15 records in my grid and next page and last page buttons are disabled.Could you help us to figure out the mistake done by me.

    Regards,
    Rajesh
  • Adrian Smith · 7 months ago
    Hi Rajesh,

    Is the "total" attribute returned in your JSON correct? (the total field in the example I give is "totalPerons" - although that's a mis-spelling, it should be "totalPersons"). This attribute should be the total number of records in the listview, not just the current page.

    Adrian
  • dhanuska · 6 months ago
    my jason is like


    { "totalPersons": 25, "persons": [ com.lk.remote.Person@1ad6b4b, com.lk.remote.Person@5f2db0, com.lk.remote.Person@b0a3f5, com.lk.remote.Person@dc41c5, com.lk.remote.Person@6214f5, com.lk.remote.Person@14e113b, com.lk.remote.Person@4d76b4, com.lk.remote.Person@1ac5f13, com.lk.remote.Person@195dd5b, com.lk.remote.Person@1f78b68]}

    Why are not showing the attributes of the Account, it's showing the object.


    and also

    JSONArray jsonPersons = new JSONArray(persons, true);

    I don't have the constructor method JSONArray with a parameter boolean like you code
  • Adrian Smith · 6 months ago
    > Why are not showing the attributes of the Account, it's showing the object.
    Is the class com.lk.remote.Person a JavaBean? http://en.wikipedia.org/wiki/JavaBean#JavaBean_...

    > I don't have the constructor method JSONArray with a parameter boolean like you code
    I'm using the JSON lib available on this page, http://www.json.org/java/index.html
  • a_mol · 5 months ago
    Now it seems so clear and simple ...

    Thanks for the great tutorial!!!