Announcement

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

  • Isomorphic
    replied
    You need to show your actual attempt. That's what is going to allow us to help.

    Leave a comment:


  • atomatom
    started a topic DMI calls to any server method

    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)
Working...
X