Announcement

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

    DataClass.setAttribute issue

    Hi,

    I'm Migrating SmartGWT version from 2.5 to 3.1 and the following error occurred when the setAttribute method of DataClass is invoked passing a list of serializable objects:

    Can not convert 0 element of the array to the JavaScriptObject. Instances of class `<dto>' can not be converted automatically. Please see the documentation of RPCRequest.data SmartClient is a table of Java types que can be converted automatically.

    This worked in version 2.5. Is there any reason for it have changed or is an error?

    I know it is possible use the method JSOHelper.setObjectAttribute but is there the possibility of making the treatment of this case into the setAttribute method?

    Thanks for helping.

    #2
    Passing an object to DMI.call

    I'm getting this same error while passing an object to DMI.call.

    Specifically my code looks like this:

    Code:
    DMI.call(
        "CedarCone", 
        "com.cedarcone.MVP1.server.RPCResponder",
        "classifyContacts", \
        callback,
        new Object[] { classifyEvent });
    classifyEvent is an object (actually a bean).

    I have been searching the documentation to see if DMI.call supports passing object/beans. I haven't found a statement that clarifies whether this is supported.

    Comment


      #3
      Any solution?

      Comment


        #4
        DMI can only be passed primitive types (Boolean, Number, String, etc) and Collections containing primitive types. The latest client-side documentation more clearly explains this.

        If you look at the documentation for DMI, you'll see that these Collections and primitive types can be used to automatically create instance of beans on the server.

        Comment

        Working...
        X