Announcement

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

    Unique Validator small enhancement for default error message when using criteriaFields

    Hi Isomorphic,

    please see this BuiltInDS based testcase (v11.1p_2018-01-11).
    I'd suggest that the default error message when using criteriaFields is instead "Values for fields Animal and Life Span must be unique"

    Also you can see that there seems to be some issue with the DetailViewer or DynamicForm, as the fields are cleared after the validation error is received (noticed by chance and not important for me).

    Click image for larger version  Name:	UniqueValidator enhancement.gif Views:	1 Size:	96.1 KB ID:	251192


    Change in animals.ds.xml:
    Code:
            <field name="commonName"      title="Animal"             type="text">
                        <validators>
                            <validator type="isUnique" criteriaFields="lifeSpan" />
                        </validators>
           </field>
    Best regards
    Blama

    #2
    On your first point, we won't try to provide an error message as you describe because it would be very problematic to handle N fields and explain how to localize the message.

    Your second point was just a minor bug in the BuiltInDS sample - we've fixed it for builds dated January 19 and later - in the meantime, you can test the fix by changing the saveBtn's click-handler like so:

    Code:
                public void onClick(ClickEvent event) {
                    boundForm.saveData(new DSCallback () {
                        @Override
                        public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                            if (dsResponse.getStatus() == DSResponse.STATUS_SUCCESS) {
                                // if the save succeeded, clear the UI
                                boundForm.clearValues();
                                saveBtn.disable();
                            }
                        }
                    });
                }

    Comment


      #3
      Hi Isomorphic,

      I can see that the sample is fixed in v11.1p_2018-01-23.
      Regarding the error message when using criteriaFields: I'll do that then manually on a per-field basis with an custom fmt-errorMessage tag. I just noticed that I should change this but thought that maybe you could also solve on the framework level.

      Best regards
      Blama

      Comment

      Working...
      X