Announcement

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

    EditFailedEvent.getDsResponse().getErrors() returns something strange

    Hi,
    I have editable grid and need to inform user about server side validation errors on grid fields which are hidden. So add handler:
    Code:
            grid.addEditFailedHandler(new EditFailedHandler() {
                public void onEditFailed(EditFailedEvent event) {
                    System.out.println(event.getDsResponse().getErrors());
                }
            });
    event.getDsResponse().getErrors() should return a Map, but it prints something like:
    Code:
    {0=[object Object], Class=Array, newInstance=
    function () {
        var _1 = [];
        isc.addPropertyList(_1, arguments);
        return _1;
    }
    , create=
    function () {
        var _1 = [];
        isc.addPropertyList(_1, arguments);
        return _1;
    }
    , observe=
    [cut]
    Am I doing something wrong ?
    MichalG

    #2
    That means getErrors() is returning an Array, which may mean the errors are being mangled somewhere before this event.

    What kind of DataSource are you using?

    Are you able to provide errors for other (visible) fields and have them show up?

    Comment


      #3
      This is WSDataSource.

      DynamicForm attached to the same ds shows up errors just fine (if field is hidden then form.setShowInlineErrors(false) makes error printed on top of the form; if field is visible then it is marked inline and error text hovers).

      Also noticed that when error is on the visible filed in my grid then it is marked but error text is "undefined" instead of right one.

      Comment


        #4
        Can you show the SOAP message that displays errors correctly in a form but not in a grid?

        Comment


          #5
          This is taken from the Developer Console:
          Code:
          <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:updateResponse xmlns:ns1="urn:operations.smartclient.com"><status>STATUS_VALIDATION_ERROR</status>
          <errors>
            <error>
              <version>Zapis został już przez kogoś zmodyfikowany.</version>
            </error>
          </errors></ns1:updateResponse></soapenv:Body></soapenv:Envelope>
          Form and grid field name with error is "version". Form displays error message while grid "unknown" text.

          Comment

          Working...
          X