Announcement

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

    DataSourceField Validation

    Hi,
    is there a way to get validation automatically working for datasourceFieldTypes?

    I have created DS A with field b of type, which is pointing to dataSource B. In both dataSources I have validate operation. If I call validate on A, is it possible that framework will trigger validate operation also on datasource B?

    Or do I need manually to create serverMethod for validate in ds A, which will trigger new validate request for ds B?

    Regards
    Matus

    #2
    If we are validating a Record with DataSource A, and for field "b" a Record is submitted, it will indeed be validated against DataSource B.

    However the resulting validation errors have no automatic way of being shown in the UI. So it usually does not make sense to use this kind of nested validation when dealing with saves initiated directly or indirectly by user action.

    Comment


      #3
      We will take care of showing validation errors to users by ourselves.

      As you say, when record for field "b" is present, it is validated against DataSource B - required field are checked, types are checked, length ...

      But more I wonder if framework can also trigger validate operation. That is - in both DataSources A and B, operationBinding of type "validate" is specified with serverObject and methodName.

      When on client side, validateData() on DS A is called, on the server side the breakpoint in the DMI method validateA() is hit, but validateB() is never called.
      Is there a way how to call validateB() automatically?

      Comment


        #4
        If you mean a separate DSRequest with operationType:"validate", no, that does not happen. What happens is just validation within the context of the *existing* DSRequest, not a new DSRequest.

        Comment

        Working...
        X