Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Loading data in the listgrid from server

    Hello there,

    I am trying to understand the way the data is fetched from the databse and displaying the data on the client side. I have a DMI which queries the database and returns the data to the listgrid. My intention is to load 100 records everytime to the client side and as it scrolls down then again fetch the next 100 and so on. but in my case all the 1999 data is loaded at once. what am I doing wrong.can somebody please help me to understand the fundamentals.

    Below is my DMI java class

    Code:
     
    Query query = hibernateSession.createSQLQuery(select);
    
            query.setResultTransformer(Transformers.aliasToBean(CusNeighbourGroupInfo.class));
    
            List<CusNeighbourGroupInfo> order = query.list();
    
            Integer rowCount = order.size();
    
            dsResponse.setStartRow(0);
            dsResponse.setEndRow(100);
            dsResponse.setTotalRows(rowCount);
            dsResponse.setData(order);
            HibernateUtills.getInstance().closeSession();
            logger.info("< fetch");
            return dsResponse;
    But as you can see in the screenshot I have attached there is just one server trip and when I scroll down nothing is changing. I am confused. when I mentioned to get 100 records why has it loaded all the data in the listgrid.

    cheers
    Zolf
    Attached Files

    #2
    Hi zaj,

    I don't know about Hibernate, but generally speaking it seems wrong just to modify the metadata of the Response. Try to modify the Request sent, either on the client or on the server.

    Also, are you sure you want/need to use Hibernate? For me, the SmartGWT SQL-generation works pretty well and you could cut off one dependency.

    Best regards,
    Blama

    Comment


      #3
      Hi Blama,

      Thanks for your feedback.

      >>generally speaking it seems wrong just to modify the metadata of the Response
      Can you please elaborate on your comment.

      >>modify the Request sent, either on the client or on the server.
      Here also can you please elaborate more.

      >>the SmartGWT SQL-generation works pretty well
      Do you mean sql templating in the datasourse.

      Thanks
      Zolf

      Comment


        #4
        Originally posted by zaj View Post
        >>generally speaking it seems wrong just to modify the metadata of the Response
        Can you please elaborate on your comment.
        You seem to modify information about what the server did. You want to change what the server does, so change either the settings of the ListGrid (resulting in changes in the client-side request) or change the incoming request on the server side.

        Originally posted by zaj View Post
        >>modify the Request sent, either on the client or on the server.
        Here also can you please elaborate more.
        See above. For the client, change the ListGrid settings, for the server generate a DMI-file, link it in the .ds.xml and do your changes to the request there.

        Originally posted by zaj View Post
        >>the SmartGWT SQL-generation works pretty well
        Do you mean sql templating in the datasourse
        I don't know. I mean the SQL SmartGWT generates when used with DataSources of serverType="sql".

        You should read the Quick Start Guide on the Smart GWT Server Framework. I'd then start with the BuiltInDS sample and try to amend it by a DMI javafile and see that this file is hit.
        Inside of this file it should become more clear what you manipulation options are.
        If your own sample is already working (the server hitting the database and returning data to the client), just amend this with server DMI (com.isomorphic classes).

        Best regards,
        Blama

        Comment


          #5
          thanks a lot for your feedbacks. I really appreciate it!!

          Comment


            #6
            Hi Blama,

            Can I have an email from you so I can email you my code as zip and you have a look at it if I am doing it the right way. If you don't mind.

            cheers
            Zolf

            Comment


              #7
              Hi Zolf,

              just post here.

              Best regards,
              Blama

              Comment

              Working...
              X