Announcement

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

    Google Gears

    Hi,

    I have been reading through the posts from xiaow on how to integrate Google Gears best with SmartClient and the direction is not clear to me.

    As far as I understand then i is not feasible to use a datasource, since a datasource always will attempt to connect to the backend.

    Can you give a hint on how best to populate a from with data from Google Gears. I imagine building a layer so I interface to the Google Gear database using xml so I need a way to load xml data into a smart client form and also get the xml data from the form when it is updated.

    Thanks a lot.

    #2
    Hi Jyden,

    xiaow's question was actually different, mostly having to do with how to round-trip data in an XML format.

    Support for Google Gears will be built in to SmartClient in a coming release. If you need to it on a particular timeline, you can contact Isomorphic here. If you prefer to implement it yourself, the recommended approach is:

    1. set dataSource.clientOnly to prevent network requests. Provide an empty Array as testData.

    2. when transformRequest is called, actually execute the request against Google Gears by forming a SQL statement from dsRequest.data. Store the response data on the dsRequest object under a property name of your choosing

    3. when transformResponse is called, pick up the response data you stored on the dsRequest object and use it to overwrite fields on dsResponse.

    Note that the dsResponse produced with be based on SmartClient's support for client-only DataSources. Between transformRequest and transformResponse, SmartClient will be making various changes to a client-side cache, which you can safely ignore. By overwriting the data produced in the dsResponse, you determine the exact response all visual component receive.

    Comment


      #3
      Thanks a lot. I followed your directions and it works fine.

      Comment


        #4
        Hello everybody,

        I am developing with SmartGWT and trying to use this instruction for a problem that I have with existing GWT-RPC Services.

        I want to populate a ListGrid with a DataSource but I am not using SmartClient Server.

        I followed the first step but can not execute step 2 because I dont know where to find transforRequest in a smartGWT DataSource.

        Does anybody know,what method of the DataSource is called when the ListGrid needs to be populated.

        This is the code where I try to populate the Grid
        Code:
        		ListGrid result = new ListGrid();
        		result.setWidth(800);
        		result.setHeight(200);
        		result.setDataSource(PDDataSource.getInstance());
        		result.setAutoFetchData(true);
        		return result;
        This is my DataSource
        Code:
        public class PDDataSource extends DataSource 
        {
        	DataSourceTextField test1= new DataSourceTextField("test1");	
        	DataSourceTextField test2 = new DataSourceTextField("test2");
        	DataSourceTextField test3 = new DataSourceTextField("test3");	
        
                public PDDataSource(String id)
        	{
        		setID(id);
        		setClientOnly(true);
        		setTestData(new DataClass[]{});
        
        		setFields(test1, test2, test3);	
        		
        	}
        }
        Regards,
        Jakob

        Comment


          #5
          Hey Jakob, now you have us curious :) Did you integrate with GWT-RPC or just use the RestDataSource approach (XML / JS messages over HTTP)?

          Comment


            #6
            Im sorry, i thought it works but using RestDataSource dont fix the problem.. I've deleted last message

            I want to integrate with GWT-RPC. I want to use existing implementations on the serverside. I' getting a list of String arrays to populate a Grid on clientside.

            Is it possible to use the Datasource concept of SmartClient in such an environment ?

            I think of a datasource, that is working on that List maybe?

            sry for my fault, didnt know that you are so quick :)

            Comment


              #7
              Any progress in this area ?

              I would like to make my application to be able to work also offline.

              How is the status realted to this issue.

              Is possible to make the app to work also offline ?

              Using Gears with SmartGWT ?

              Using Gears with SmartGWT EE ?

              Any idea ,guidance is welcomed ! THx
              Last edited by ytrewqsm; 12 Aug 2009, 12:59.

              Comment


                #8
                Hi ytrewqsm,

                This can now be done a little more cleanly using dataProtocol:"clientCustom" - see the docs for that attribute.

                Comment


                  #9
                  Hi,

                  Is it possible to use smartGWT without datasource? i mean directly using the LIST of java objects into listgrids or comboboxes.
                  Last edited by saransmartgwt; 16 Aug 2011, 19:10.

                  Comment

                  Working...
                  X