Announcement

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

    Does the Validator.addValidator exist in SmartGWT?

    I read in the SmartGWT java-doc for a Validator class that - "Custom validators can be reused on the client by adding them to the global validator list, via the Validator.addValidator method."
    But it seems that there is NO this method in the Validator class.

    Is there some other method or another way to add my custom validator class to the global validator list?

    Thank you.

    #2
    If you just want to reuse the validator, you can use it in your FormItem.setValidators() call as many times as you want.

    Comment


      #3
      Thanks for your reply.
      In fact my goal was 1) Create my own validator extending a Validaor class
      2) set my own type setAttribute("type", "myvalidatortype") and attribute "myattribute"

      and after that I would like to use a "metadata" as a js object like this[{"type":"contains","substring":"111"},{"type":"myvalidatortype","myattribute":"}]
      and create array of validators using the constructor -
      public Validator(JavaScriptObject jsObj).

      I hoped that by adding to "the global validator list" it is possible and even found in java-doc Validator.addValidator method .... "Custom validators can be reused on the client by adding them to the global validator list, via the Validator.addValidator method." ... but there is NO this method in the Validator class itself.

      Would you recommend any way to implement the goal like this one?

      Thank you.

      Comment

      Working...
      X