Announcement

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

    form.validate() returns true when there's a server validation error

    SmartClient Version: v9.0p_2013-10-15/EVAL Development Only

    Chrome

    please modify sample #FSdmiValidation like this:
    Code:
    isc.DynamicForm.create({
        dataSource: "validationDMI_orderForm",
        fields: [
            { type: "header", defaultValue: "Add an item to your Order" },
            { name: "itemId", title: "Item", editorType: "ComboBoxItem", optionDataSource: "StockItem",
                valueField: "id", displayField: "description" },
            { name: "quantity", validateOnExit: true },
            { name: "instructions", editorType: "TextAreaItem" },
            { type: "button", title: "Submit Order", click: function (form, item) {
                if (form.validate()) {
                    isc.logWarn('validate returns true')
                    form.saveData()
                }
            }
            }
        ]
    });
    and follow the instructions of the original sample: you'll see that the validate() method will return true even if the DMI validation fails

    #2
    Yes, validate() is synchronous so it can't call the server. The docs cover this.

    Comment


      #3
      Sorry but I don't understand.
      validate() IS calling the Dmi validator, isn't it?

      Comment


        #4
        Looks like you still have not read the docs for dynamicForm.validate(). Start there.

        Comment


          #5
          sorry, actually I was reading ValuesManager.validate() documentation, because in my code I'm calling that method.

          I hope I can still use the DynamicForm.handleAsyncValidationReply() method, I'll try it.

          Comment


            #6
            ok, I think I got it, thanks for pointing me to the right docs.
            BTW I think that a link from ValuesManager.validate() docs to DynamicForm.validate() would be nice.

            I think that DynamicForm.validateData() is what I'm looking for. Isn't the same method available for ValuesManager?
            If I try to call it on a ValuesManager it seems to work, but I couldn't find it in the docs.

            Comment

            Working...
            X