Announcement

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

  • Async Validator condition?

    Do you have an approach I could use to implement an asynchronous Validator.condition (or some other way to get a Validator)? I want to use an ajax call to validate the value on a server that doesn't have the ISC jars (which seem to be necessary to use serverCondition/serverObject). The ajax call is expected to return quickly, but I'd rather not wrap it in a loop checking for some semaphore.

    I have compatibility issues with async/await javascript functionality.

  • #2
    At the moment there isn't a way for a "serverCustom" validator to work without the SmartClient server, and it's not that trivial to add, as we'd need to document a whole new operationType and return value, serialization format, etc.

    The best way to do this with our server tech would be to define a validator that always returns true, make an asynchronous call with a protocol of your own design, and then applies errors via FormItem.setErrors() or similar APIs. Just be sure to get the nuances right, such as not applying errors if the value has been changed again, or a second attempt has been made at validation before the async call completes.

    Also note that, if you want this as a feature available in LGPL edition, you can use Feature Sponsorship to get it.

    Comment

    Working...
    X