Announcement

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

  • AnutharshaSelvarasa
    replied
    Hi,

    I fixed it. I called formItem.getErrors(). and it works.

    Thank you.

    Leave a comment:


  • AnutharshaSelvarasa
    replied
    Hi,
    please help me with this. After calling validateData method, I use code like this,

    if (form.validate()) {
    setRecordValues(); // this code is for setting values to seleced record
    close();
    }

    If I don't use this "close()" method. Validations are appearing. Everthing working fine. But When use "close()" method, validations are not appearing eventhough i use close() method like above
    Last edited by AnutharshaSelvarasa; 7 Nov 2018, 00:50.

    Leave a comment:


  • Isomorphic
    replied
    Sorry, that didnít make much sense. There is no automatic behavior in form validation that would close a pop-up window. Thatís your code doing that, so you need to correct it if you donít want the pop up closed.

    Leave a comment:


  • AnutharshaSelvarasa
    replied
    Hi,

    In my case, the form is in a popup window. If form valid only i should close the popup window. If I m not calling form.validate(), the popup window always close regardless the validation.

    I even try to call form.hasErrors(), that's also didn't work.
    Last edited by AnutharshaSelvarasa; 6 Nov 2018, 21:54.

    Leave a comment:


  • Isomorphic
    replied
    When you call validateData(), errors are automatically applied to the form, so you should not have code that clears errors on other fields.

    Calling validate() again would also clear the error you just applied, and isn't necessary anyway.

    Leave a comment:


  • Dynamic form setting errors to formItem

    Hi,

    I have a form and three combo box items set to that form. I have to validate the form using the results coming from server side.

    I use,

    form.validateData(model,new DSCallback() {
    @Override
    public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
    Record record = dsResponse.getData[0];
    if (record.getFlag()) {
    comboBox.clearErrors();
    comboBox.setShowErrorIcon(true);
    comboBox.setErrors("error");
    }

    if (form.validate()) {
    SC.say("valid");
    }
    }
    });

    First time, error setting is working. But the second time errors are not setting. You can see, I clear the errors before setting new errors.
Working...
X