Announcement

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

    ServerCustom validator: lookupStyle="factory"

    Hi,

    I am trying to implement a validator with lookupStyle="factory" to minimize object creation using "new". Am able to call factory class and struck up with passing value to it to identify which object need to be created.

    I used very basic factory implementation.
    1.V*Enum.java for validator types.
    2.V*.java abstract class.
    3.V*Factory.java calling class from ds.xml and return object for DMI. Use "create" method to return the object.

    Some how i need to pass the value in V*Factory.java from *.ds.xml to identify which validator need to be picked.

    #2
    Hi nicemoorthy,

    did you see http://www.smartclient.com/smartgwte...ml#lookupStyle and the linked http://www.smartclient.com/smartgwte...iOverview.html?

    In the 1st document it says:
    Like the DMI methods, the create method can request a standard set of values as arguments. See DMI for a list of available values.

    If you read the very end of the 2nd document, I'd say, that this signature should work: create(RPCRequest rpcRequest)
    Can you get the values you need from the request? Is the method also executed with this signature (try setting a breakpoint).

    I never tried this, but perhaps it will work.

    Best regards,
    Blama

    Comment


      #3
      Thanks Blama. Tried the suggestions but getting below exception.

      === 2014-05-15 10:11:51,382 [l0-0] WARN RequestContext - dsRequest.execute() failed:
      com.isomorphic.util.ValidatorException: Bad serverObject declaration:
      {
      className:"com.xxxx.server.validator.RYValidationFactory",
      lookupStyle:"factory",
      methodName:"condition"
      }
      ..led to exception:
      java.lang.Exception: Unable to assign a required or optional argument to slot #1 taking type: com.isomorphic.datasource.DSRequest of method:

      public static com.xxxx.server.validator.RYValidation com.xxxx.server.validator.RYValidationFactory.create(com.isomorphic.datasource.DSRequest)

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


      at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:963)
      at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:804)
      at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:139)
      at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:70)

      Comment


        #4
        Hi nicemoorthy,

        sorry it didn't work. Let's see what Isomorphic says.

        Best regards,
        Blama

        Comment

        Working...
        X