Announcement

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

    DMI calls to any server method

    I think this could perhaps be one of the most useful ways of connecting my server logic to the client. But I'm having troubles.

    From the docs p57:
    DMI Method Arguments

    The methodArguments attribute can be added to an
    <operationBinding> to configure specific arguments that should be
    passed to a DMI method. For example, given a Java method:

    Code:
    List<Lead> getRelatedLeads(long accountId, boolean includeDeleted)
    You might call this method via a DMI declaration like:

    Code:
    <operationBinding operationType="fetch"> 
    <serverObject className="com.sample.DMIHandler"
    methodName="doFullTextSearch"
    methodArguments="$criteria.accountId,false"/>
    </operationBinding>
    Because the getRelatedLeads method returns a List of Java
    Beans—a format compatible with dsResponse.setData()—there is
    no need to create or populate a DSResponse. Combining this with
    the methodArguments attribute allows you to call pre-existing Java
    business logic with no Smart GWT-specific server code at all,
    without even the need to import Smart GWT libraries code in your
    server-side logic.
    I really want to get this working, but I fear the above example is broken in more than a few ways. The obvious 'doFullTextSearch' is not 'getRelatedLeads' but I think there are some more errors in the way it's laid out.

    I would greatly appreciate an example that works.

    No matter what I try, it seems to complain that "Operation type 'fetch' not supported by this DataSource"

    Code:
    === 2011-01-14 21:24:20,644 [57-6] DEBUG AppBase - [builtinApplication.myDMI_DataSource_fetch] No public zero-argument method named '_myDMI_DataSource_fetch' found, performing generic datasource operation
    === 2011-01-14 21:24:20,646 [57-6] WARN  RequestContext - dsRequest.execute() failed: 
    java.lang.Exception: Operation type 'fetch' not supported by this DataSource (myDMI_DataSource)
    	at com.isomorphic.datasource.DataSource.notSupported(DataSource.java:1874)
    	at com.isomorphic.datasource.DataSource.executeFetch(DataSource.java:1814)
    	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1048)
    	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
    	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
    	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
    	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1443)
    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:173)

    #2
    You need to show your actual attempt. That's what is going to allow us to help.

    Comment


      #3
      Ok, I made a sample.

      Here are the parts:

      DataSource def

      Code:
      <DataSource ID="dmiMethod_DataSource" serverType="generic"
      	schemaBean="com.sample.data.MyResultClass">
      	<fields>
      		<field name="id" type="string" primaryKey="true" />
      	</fields>
      
      
      	<operationBinding operationType="fetch">
      		<serverObject className="com.teamsync.server.DMIHandler"
      			methodName="getSome" methodArguments="$criteria.aValue,$criteria.bValue,$criteria.cValue" />
      	</operationBinding>
      
      </DataSource>
      The data object to be returned
      Code:
      import java.io.Serializable;
      
      public class MyResultClass implements Serializable {
      
      	private static final long serialVersionUID = 7219106680608399931L;
      
      	private String id;
      
      	private String value;
      
      	public void setId(String id) {
      		this.id = id;
      	}
      
      	public String getId() {
      		return id;
      	}
      
      	public void setValue(String value) {
      		this.value = value;
      	}
      
      	public String getValue() {
      		return value;
      	}
      
      }
      The DMI method

      Code:
      public class DMIHandler {
      
      	public List<MyResultClass> getSome(Long a, Long b, Long c) {
      		List<MyResultClass> result = new ArrayList<MyResultClass>();
      		MyResultClass test = new MyResultClass();
      		test.setId("123");
      		if (a != null && b != null && c != null)
      			test.setValue("gimme some " + (a + b + c));
      		else
      			test.setValue("none for you");
      		result.add(test);
      		return result;
      	}
      }

      And some code that uses it

      Code:
      		DataSource ds = DataSource.get("dmiMethod_DataSource");
      		final ListGrid grid = new ListGrid();
      		grid.setDataSource(ds);
      	
      		Button button1 = new Button("No criteria fetch");
      		button1.addClickHandler(new ClickHandler() {
      			@Override
      			public void onClick(ClickEvent event) {
      				grid.fetchData();
      			}
      		});
      
      		Button button2 = new Button("Criteria fetch");
      		button2.addClickHandler(new ClickHandler() {
      			@Override
      			public void onClick(ClickEvent event) {
      				Criteria criteria = new Criteria();
      				criteria.setAttribute("aValue", 1);
      				criteria.setAttribute("bValue", 3);
      				criteria.setAttribute("cValue", 5);
      				grid.fetchData(criteria);
      			}
      		});
      
      		VStack stack = new VStack();
      		stack.addMember(button1);
      		stack.addMember(button2);
      		stack.addMember(grid);
      
      		stack.setSize("100%", "100%");
      		grid.setSize("400", "200");
      
      		stack.draw();

      And here is the stacktrace when it tries to fetch. First with no criteria, then with criteria.
      Code:
      Initializing AppEngine server
      Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
      Successfully processed /home/tom/workspace/sample2/war/WEB-INF/appengine-web.xml
      Successfully processed /home/tom/workspace/sample2/war/WEB-INF/web.xml
      jetty-6.1.x
      ISC: Configuring log4j from: file:/home/tom/workspace/sample2/war/WEB-INF/classes/log4j.isc.config.xml
      === 2011-01-14 23:37:01,948 [main] INFO  ISCInit - Isomorphic SmartClient Framework - Initializing
      === 2011-01-14 23:37:01,973 [main] INFO  ConfigLoader - Attempting to load framework.properties from CLASSPATH
      === 2011-01-14 23:37:02,232 [main] INFO  ConfigLoader - Successfully loaded framework.properties from CLASSPATH at location: jar:file:/home/tom/workspace/sample2/war/WEB-INF/lib/isomorphic_core_rpc.jar!/framework.properties
      === 2011-01-14 23:37:02,232 [main] INFO  ConfigLoader - Attempting to load project.properties from CLASSPATH
      === 2011-01-14 23:37:02,233 [main] INFO  ConfigLoader - Unable to locate project.properties in CLASSPATH
      === 2011-01-14 23:37:02,266 [main] INFO  ConfigLoader - Successfully loaded isc_interfaces.properties from CLASSPATH at location: jar:file:/home/tom/workspace/sample2/war/WEB-INF/lib/isomorphic_core_rpc.jar!/isc_interfaces.properties
      === 2011-01-14 23:37:02,266 [main] INFO  ConfigLoader - Attempting to load server.properties from CLASSPATH
      === 2011-01-14 23:37:02,276 [main] INFO  ConfigLoader - Successfully loaded server.properties from CLASSPATH at location: file:/home/tom/workspace/sample2/war/WEB-INF/classes/server.properties
      === 2011-01-14 23:37:02,290 [main] INFO  Logger - Logging system started.
      === 2011-01-14 23:37:02,291 [main] INFO  ISCInit - Isomorphic SmartClient Framework (SC_SNAPSHOT-2011-01-13/EVAL Deployment 2011-01-13) - Initialization Complete
      === 2011-01-14 23:37:02,292 [main] INFO  ISCInit - Auto-detected webRoot - using: /home/tom/workspace/sample2/war
      Started SelectChannelConnector@0.0.0.0:8888
      The server is running at http://localhost:8888/
      === 2011-01-14 23:37:10,347 [30-0] INFO  PoolManager - SmartClient pooling disabled for 'dmiMethod_DataSource' objects
      === 2011-01-14 23:37:10,538 [30-0] DEBUG XML - Parsed XML from /home/tom/workspace/sample2/war/ds/dmiMethod_DataSource.ds.xml: 4ms
      === 2011-01-14 23:37:10,545 [30-0] DEBUG XML - Parsed XML from /home/tom/workspace/sample2/war/sample/sc/system/schema/DataSource.ds.xml: 6ms
      === 2011-01-14 23:37:10,553 [30-0] DEBUG XML - Parsed XML from /home/tom/workspace/sample2/war/sample/sc/system/schema/builtinTypes.xml: 4ms
      === 2011-01-14 23:37:10,720 [30-0] DEBUG XML - Parsed XML from /home/tom/workspace/sample2/war/sample/sc/system/schema/DataSourceField.ds.xml: 5ms
      === 2011-01-14 23:37:37,469 [30-6] INFO  RequestContext - URL: '/sample/sc/IDACall', User-Agent: 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13': Moz (Gecko) with Accept-Encoding header
      === 2011-01-14 23:37:37,491 [30-6] DEBUG XML - Parsed XML from (in memory stream): 2ms
      === 2011-01-14 23:37:37,495 [30-6] DEBUG XML - Parsed XML from /home/tom/workspace/sample2/war/sample/sc/system/schema/List.ds.xml: 2ms
      === 2011-01-14 23:37:37,500 [30-6] DEBUG RPCManager - Processing 1 requests.
      === 2011-01-14 23:37:37,512 [30-6] DEBUG RPCManager - Request #1 (DSRequest) payload: {
          criteria:{
          },
          operationConfig:{
              dataSource:"dmiMethod_DataSource",
              operationType:"fetch",
              textMatchStyle:"exact"
          },
          startRow:0,
          endRow:75,
          componentId:"isc_ListGrid_0",
          appID:"builtinApplication",
          operation:"dmiMethod_DataSource_fetch",
          oldValues:{
          }
      }
      === 2011-01-14 23:37:37,517 [30-6] INFO  IDACall - Performing 1 operation(s)
      === 2011-01-14 23:37:37,526 [30-6] DEBUG AppBase - [builtinApplication.dmiMethod_DataSource_fetch] No userTypes defined, allowing anyone access to all operations for this application
      === 2011-01-14 23:37:37,526 [30-6] DEBUG AppBase - [builtinApplication.dmiMethod_DataSource_fetch] No public zero-argument method named '_dmiMethod_DataSource_fetch' found, performing generic datasource operation
      === 2011-01-14 23:37:37,527 [30-6] WARN  RequestContext - dsRequest.execute() failed: 
      java.lang.Exception: Operation type 'fetch' not supported by this DataSource (dmiMethod_DataSource)
      	at com.isomorphic.datasource.DataSource.notSupported(DataSource.java:1874)
      	at com.isomorphic.datasource.DataSource.executeFetch(DataSource.java:1814)
      	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1048)
      	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
      	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
      	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
      	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1443)
      	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:173)
      	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:130)
      	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:95)
      	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      	at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      === 2011-01-14 23:37:37,530 [30-6] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
      === 2011-01-14 23:37:37,532 [30-6] DEBUG RPCManager - non-DMI response, dropExtraFields: false
      === 2011-01-14 23:37:41,070 [30-3] INFO  RequestContext - URL: '/sample/sc/IDACall', User-Agent: 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13': Moz (Gecko) with Accept-Encoding header
      === 2011-01-14 23:37:41,073 [30-3] DEBUG XML - Parsed XML from (in memory stream): 2ms
      === 2011-01-14 23:37:41,126 [30-3] DEBUG RPCManager - Processing 1 requests.
      === 2011-01-14 23:37:41,142 [30-3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
          criteria:{
              aValue:1,
              bValue:3,
              cValue:5
          },
         operationConfig:{
              dataSource:"dmiMethod_DataSource",
              operationType:"fetch",
              textMatchStyle:"exact"
          },
          startRow:0,
          endRow:75,
          componentId:"isc_ListGrid_0",
          appID:"builtinApplication",
          operation:"dmiMethod_DataSource_fetch",
          oldValues:{
          }
      }
      === 2011-01-14 23:37:41,142 [30-3] INFO  IDACall - Performing 1 operation(s)
      === 2011-01-14 23:37:41,144 [30-3] DEBUG AppBase - [builtinApplication.dmiMethod_DataSource_fetch] No userTypes defined, allowing anyone access to all operations for this application
      === 2011-01-14 23:37:41,148 [30-3] DEBUG AppBase - [builtinApplication.dmiMethod_DataSource_fetch] No public zero-argument method named '_dmiMethod_DataSource_fetch' found, performing generic datasource operation
      === 2011-01-14 23:37:41,148 [30-3] WARN  RequestContext - dsRequest.execute() failed: 
      java.lang.Exception: Operation type 'fetch' not supported by this DataSource (dmiMethod_DataSource)
      	at com.isomorphic.datasource.DataSource.notSupported(DataSource.java:1874)
      	at com.isomorphic.datasource.DataSource.executeFetch(DataSource.java:1814)
      	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1048)
      	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
      	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
      	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
      	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1443)
      	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:173)
      	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:130)
      	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:95)
      	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      	at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      === 2011-01-14 23:37:41,149 [30-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
      === 2011-01-14 23:37:41,149 [30-3] DEBUG RPCManager - non-DMI response, dropExtraFields: false

      Development Mode Console (javascript stacktrace)
      Code:
      15:45:50.662 [ERROR] [test] 15:45:50.661:XRP1:WARN:RPCManager:Operation type 'fetch' not supported by this DataSource (dmiMethod_DataSource), response: {operationId: &quot;dmiMethod_DataSource_fetch&quot;,
      clientContext: Obj,
      context: Obj,
      transactionNum: 0,
      httpResponseCode: 200,
      httpResponseText: &quot;//isc_RPCResponseStart--&gt;[{queueStatus:-...&quot;[199],
      xmlHttpRequest: [object XMLHttpRequest],
      transport: &quot;xmlHttpRequest&quot;,
      status: -1,
      clientOnly: undef,
      httpHeaders: Obj,
      isStructured: true,
      callbackArgs: null,
      results: Obj,
      queueStatus: -1,
      isDSResponse: true,
      invalidateCache: false,
      data: &quot;Operation type 'fetch' not supported by ...&quot;[78],
      startRow: 0,
      endRow: 0,
      totalRows: 0}
      
      com.smartgwt.client.core.JsObject$SGWT_WARN: 15:45:50.661:XRP1:WARN:RPCManager:Operation type 'fetch' not supported by this DataSource (dmiMethod_DataSource), response: {operationId: &quot;dmiMethod_DataSource_fetch&quot;,
      clientContext: Obj,
      context: Obj,
      transactionNum: 0,
      httpResponseCode: 200,
      httpResponseText: &quot;//isc_RPCResponseStart--&gt;[{queueStatus:-...&quot;[199],
      xmlHttpRequest: [object XMLHttpRequest],
      transport: &quot;xmlHttpRequest&quot;,
      status: -1,
      clientOnly: undef,
      httpHeaders: Obj,
      isStructured: true,
      callbackArgs: null,
      results: Obj,
      queueStatus: -1,
      isDSResponse: true,
      invalidateCache: false,
      data: &quot;Operation type 'fetch' not supported by ...&quot;[78],
      startRow: 0,
      endRow: 0,
      totalRows: 0}
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          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(Thread.java:662)
      The second Dev Console javascript stacktrace (with criteria)
      Code:
      15:45:54.392 [ERROR] [test] 15:45:54.391:XRP0:WARN:RPCManager:Operation type 'fetch' not supported by this DataSource (dmiMethod_DataSource), response: {operationId: &quot;dmiMethod_DataSource_fetch&quot;,
      clientContext: Obj,
      context: Obj,
      transactionNum: 1,
      httpResponseCode: 200,
      httpResponseText: &quot;//isc_RPCResponseStart--&gt;[{queueStatus:-...&quot;[199],
      xmlHttpRequest: [object XMLHttpRequest],
      transport: &quot;xmlHttpRequest&quot;,
      status: -1,
      clientOnly: undef,
      httpHeaders: Obj,
      isStructured: true,
      callbackArgs: null,
      results: Obj,
      queueStatus: -1,
      isDSResponse: true,
      invalidateCache: false,
      data: &quot;Operation type 'fetch' not supported by ...&quot;[78],
      startRow: 0,
      endRow: 0,
      totalRows: 0}
      
      com.smartgwt.client.core.JsObject$SGWT_WARN: 15:45:54.391:XRP0:WARN:RPCManager:Operation type 'fetch' not supported by this DataSource (dmiMethod_DataSource), response: {operationId: &quot;dmiMethod_DataSource_fetch&quot;,
      clientContext: Obj,
      context: Obj,
      transactionNum: 1,
      httpResponseCode: 200,
      httpResponseText: &quot;//isc_RPCResponseStart--&gt;[{queueStatus:-...&quot;[199],
      xmlHttpRequest: [object XMLHttpRequest],
      transport: &quot;xmlHttpRequest&quot;,
      status: -1,
      clientOnly: undef,
      httpHeaders: Obj,
      isStructured: true,
      callbackArgs: null,
      results: Obj,
      queueStatus: -1,
      isDSResponse: true,
      invalidateCache: false,
      data: &quot;Operation type 'fetch' not supported by ...&quot;[78],
      startRow: 0,
      endRow: 0,
      totalRows: 0}
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          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(Thread.java:662)
      Last edited by carchrae; 14 Jan 2011, 15:55.

      Comment


        #4
        As an aside, the test code makes a grid that is 'twitching' showing and hiding the scrollbars after it runs. This is using the TreeFrog skin.

        Comment


          #5
          Didn't need a test case here, just needed to see your XML at all. It's malformed, causing your operationBindings to be ignored. See any sample; you need an <operationBindings> tag (note the "s") and then <operationBinding> tags within that (with attributes such as operationType).

          Comment


            #6
            Note you're also declaring redundant and conflicting methods - serverMethod and serverObject.methodName specify the same thing.

            Comment


              #7
              Ah, great. Thanks.

              But still not going.

              Unable to assign a required or optional argument to slot #1 taking type: java.lang.Long of method:

              public java.util.List com.sample.server.DMIHandler.getSome(java.lang.Long,java.lang.Long,java.lang.Long)

              No remaining optional arguments match this type and all required arguments passed by the client have already been assigned.

              Updated the operationBindings.
              Code:
              <DataSource ID="dmiMethod_DataSource" serverType="generic"
              	schemaBean="com.sample.data.MyResultClass">
              	<fields>
              		<field name="id" type="string" primaryKey="true" />
              	</fields>
              
              	<operationBindings>
              		<operationBinding operationType="fetch">
              			<serverObject className="com.sample.server.DMIHandler"
              				methodName="getSome" methodArguments="$criteria.aValue,$criteria.bValue,$criteria.cValue" />
              		</operationBinding>
              	</operationBindings>
              </DataSource>

              Comment


                #8
                methodArguments goes on the operationBinding, not the serverObject.

                Comment


                  #9
                  Excellent. It works. Thank you for going through that with me. Note that the documentation I posed originally is wrong on a few counts, so please put a bug against that.

                  In general, it would be nice if the examples in the manual can include the full file instead of small excerpts. If something is to be highlighted, use bold. Or include the full example at the end of each section.

                  Here's the working DataSource definition.

                  Code:
                  <DataSource ID="dmiMethod_DataSource" serverType="generic"
                  	schemaBean="com.sample.data.MyResultClass">
                  	<fields>
                  		<field name="id" type="string" primaryKey="true" />
                  	</fields>
                  
                  	<operationBindings>
                  		<operationBinding operationType="fetch"
                  			methodArguments="$criteria.aValue,$criteria.bValue,$criteria.cValue">
                  			<serverObject className="com.sample.server.DMIHandler"
                  				methodName="getSome" />
                  		</operationBinding>
                  	</operationBindings>
                  </DataSource>

                  Comment


                    #10
                    By the way, is it necessary for each DataSource to have a primary key? My guess was yes, or else the data-bound components won't know what to index each record with.

                    Comment


                      #11
                      It's required unless the only valid operation is "fetch".

                      Comment


                        #12
                        Also, I just checked, that scrollbar appearing-disappearing quickly bug (happens after you click a button in the example above), does not appear in the default theme.

                        It's pretty bad in the TreeFrog theme though... epileptic.

                        Comment


                          #13
                          the twitchy scrollbar syndrome is happening with that example in the regular theme now as well.

                          it goes away when i resize the browser and it starts when i hit a button and a dialog window appears then disappers.

                          Comment


                            #14
                            By the way, is there a log level I can turn on to spot XML errors? I've had things mis-spelled before and they are difficult to spot.

                            Comment


                              #15
                              Sorry, because the format is extensible, we can't tell the difference between typos vs new properties you're adding.

                              Comment

                              Working...
                              X