Announcement

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

  • Blama
    replied
    Hi Isomorphic,

    Originally posted by Isomorphic View Post
    When using isUnique validator and calling validate() directly, you should place the PK field (itemID here) into each form so it is sent to the server with the validation request. It is needed to isolate the current record from the check.
    This sounds like a solution. I did not try this yet and will do so now.

    Originally posted by Isomorphic View Post
    Simple testing of changing the item from 45300 to 90600 did result in a failed validation for SKU being unique. However, the wrapper around VM.saveData() with a call to validate() isn't valid for this test. validate() validates client fields locally then issues a server request to validate the isUnique validator. The server request is asynchronous so the result of validate() only indicates success validating on the client. The update server call will also run all validators so a duplicate SKU will be trapped during the save.
    OK, thanks for the explanation. Further question in this area after reading the docs: Is there a difference between DynamicForm.validate() and DynamicForm.validateData() or are they synonyms? Also, there is DynamicForm.validateData(DSCallback), but no such method taking a CallBack on ValuesManager. Is it missing?

    Best regards
    Blama

    Leave a comment:


  • Isomorphic
    replied
    Simple testing of changing the item from 45300 to 90600 did result in a failed validation for SKU being unique. However, the wrapper around VM.saveData() with a call to validate() isn't valid for this test. validate() validates client fields locally then issues a server request to validate the isUnique validator. The server request is asynchronous so the result of validate() only indicates success validating on the client. The update server call will also run all validators so a duplicate SKU will be trapped during the save.

    In general a VM performs validation per-form and only for items actually defined on the form. The category and unitCost fields are not defined on any form so they are ignored by the client validation. The server validation noticed the issue and reported it but the client discards these errors and will call VM.hiddenValidationErrors() if defined. You will notice that on the update request category and unitCost are included because they are part of the complete record.

    When using isUnique validator and calling validate() directly, you should place the PK field (itemID here) into each form so it is sent to the server with the validation request. It is needed to isolate the current record from the check.

    Leave a comment:


  • Blama
    started a topic ValuesManager.validate() bug : No request is sent

    ValuesManager.validate() bug : No request is sent

    Hi Isomorphic,

    I have the following problem using 10.0p_2015-08-24/PowerEdition Deployment:

    See attached testcase and add the following to your supplyItem.ds.xml's SKU-field:
    Code:
    <validators><validator type="isUnique" errorMessage="SKU already in use!" /></validators>
    1. Set a breakpoint in Dev Mode on "Boolean doesNotTriggerRequest..." AND "if (doesNotTriggerRequest)".
    2. Open the sample, change the SKU and click save.
    3. First breakpoint is hit.
    4. Clear the server log.
    5. Hit F8
    6. See that there is nothing in the server log (validate() did not validate the change to SKU, this is the 1st bug) Click image for larger version

Name:	Breakpoints.png
Views:	237
Size:	15.1 KB
ID:	231566
    7. Hit F8 again
    8. See the Developer Console. Although the validation, which occurred now for the super.save(), had errors (missing required fields), the update was executed (this is the 2nd bug). Click image for larger version

Name:	DeveloperConsole.png
Views:	218
Size:	56.2 KB
ID:	231565
    Best regards
    Blama
    Attached Files
Working...
X