Announcement

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

    Populate ListGrid from postgres DB

    Hi,

    I'd like to know what would be the best way to:

    1. populate a ListGrid with data selected from a postgresql DB ( a query involving more tables, not a simple table view )

    2. populate a editable listgrid from a single table and save the edits in the table as they are made

    3. accomplish 1 & 2 at the same time

    Note: i'd like to do as much as possible in Java code, but if you think the overhead is too great, any solution would be appreciated.

    Thanks !

    #2
    Start with the QuickStart Guide, focus on the Server Framework chapter, SQL Templating and related examples.

    Comment


      #3
      Originally posted by Isomorphic
      Start with the QuickStart Guide, focus on the Server Framework chapter, SQL Templating and related examples.
      I started by editing the "custom-ds" example and followed the sample from : http://www.smartclient.com/smartgwte...e_valuemap_sql

      I get this error when I try to fetch the data in the list:

      Transport error - HTTP code: 404 for URL: http://127.0.0.1:8888/customds/sc/IDACall

      This is the code:
      Code:
      DataSource dataSource = DataSource.get("listing_users");
      	  
      m_ListView.setDataSource(dataSource);  
      	        	  
      ListGridField userIdField = new ListGridField("user_id", "Id");
      ListGridField userNameField = new ListGridField("user_name", "Name");
      	  
      m_ListView.setFields(userIdField, userNameField);
      m_ListView.fetchData();
      -----------ST----------

      com.smartgwt.client.core.JsObject$SGWT_WARN: 10:18:25.778:TMR4[E]:WARN:ListGrid:isc_ListGrid_1:autoFetchData is set, but no dataSource is specified, can't fetch
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
      at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
      at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
      at java.lang.Thread.run(Unknown Source)


      ---------------NOTE------------------
      I also get this:

      Failed to get log data - error: Transport error - HTTP code: 404 for URL: http://127.0.0.1:8888/customds/sc/ID...=1&isc_noLog=1

      when I access Server Logs from the Developer Console.
      Last edited by Vali; 23 Jun 2011, 00:58.

      Comment


        #4
        Use the installation steps linked from the QuickStart Guide, and don't skip any steps.

        Comment

        Working...
        X