Announcement

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

    #16
    Originally posted by Isomorphic View Post
    If you programmatically DataSource.addData(), which field is being validated?
    Agreed. However we don't use that functionality because we don't have a scenario where data needs to be added into a grid purely client side. (I realise addData is not specific to grid's, I'm just using that as a concrete example. The more concrete examples you've used in your last post help a lot.)

    Originally posted by Isomorphic View Post
    If the user makes several changes, navigates away for a while, navigates back and clicks Save, without ever putting focus in a field, which field is being validated?
    Validates are being called for each change of the "several changes". If the server is being notified of each change of field then its those individual messages that contain the field being validated. I don't see this example as valid, at least not in the way we use smartclient.

    Originally posted by Isomorphic View Post
    In both of these cases, and many others, there is no specific field being validated.
    I agree there are lots of cases, however we don't use any of them. That means we are currently hamstrung by the behaviour of it sending the values of all fields when we only want it to send the single field that needs validation in the most common scenario of a user simply filling out the fields of a form.

    It sounds like we can't use data sources for validation, or at least not optimally for the way our system works (i.e. a system where the server stores the state of all fields).

    Perhaps we can provide a standard client side validator which always returned true but also sent our own custom message to the server and in the response we use the setFieldErrors/clearFieldErrors APIs.

    But, superficially speaking, if dsRequest.clientContext.fieldName was made publicly available (being null when there is no single field) it would make life a lot easier.

    Comment


      #17
      If you're contacting the server on every single client-side change, then the solution is obvious: just remember the last set of values you sent and figure out which value changed.

      Just a note that this is a gross misuse of SmartClient. The whole point of the system is to improve scalability and responsiveness by reducing server contact and server load.

      Comment

      Working...
      X