Announcement

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

    ValuesManager.validate() not displaying error messages consitently

    Hi Isomorphic
    I am facing an issue where the validate function on the valuesManager does not highlight the formItems in error state unless I click on the formItem. I have created a small sample which demonstrates the issues.
    Code:
    public class DemoApp implements EntryPoint {
    
        public void onModuleLoad() {
            final VLayout appLayout = new VLayout();
            appLayout.setWidth100();
            appLayout.setHeight100();
    
            final DynamicForm dynamicForm = new DynamicForm();
    
            final TextItem textItemID = new TextItem("id", "ID");
            textItemID.setRequired(true);
            final TextItem textItemName = new TextItem("name", "Name");
            textItemName.setRequired(true);
            final TextItem textItemDescription = new TextItem("description", "Description");
            dynamicForm.setFields(textItemID, textItemName, textItemDescription);
    
            final ValuesManager valuesManager = new ValuesManager();
            valuesManager.addMember(dynamicForm);
    
            IButton saveButton = new IButton("Validate Form");
            saveButton.setWidth(150);
            saveButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    if (valuesManager.validate()) {
                        SC.say("Form has no validation errors");
                    }
                }
            });
            appLayout.addMember(dynamicForm);
            appLayout.addMember(saveButton);
            appLayout.draw();
        }
    }
    When you submit the form the first time with a validation error, it will highlight the formItem with an error. Now on updating the content in the form with additional/different errors, the formitems do not get updated to show the new errors. You need to click on each formItem to get it to update.

    This issue exists in the smartGWT version v9.0p_2013-07-14/Enterprise Deployment 2013-07-14. However it is not present in the earlier version v8.3p_2013-05-05/Enterprise Deployment 2013-05-05. I have tried this in Firefox 12.0 and Chrome
    Attached Files

    #2
    We're having difficulty understanding exactly what you're seeing from the description.
    Can you give us the actual steps you're taking with the attached app, detailing what you expect to see vs what you actually see.
    For example
    1) launch the app and hit "validate"
    2) use the mouse to click in each field and type some value
    3) hit "validate" again
    Expected behavior: Validation errors disappear
    Actual behavior: Something else

    (Note this was the test we ran, and the validation errors did disappear as expected, but this doesn't seem to match your description)

    Thanks
    Isomorphic Software

    Comment


      #3
      1. Launch App
      2. Enter a value for ID only
      3. Click Validate Form . (Name is in error state as expected -ValidateForm01.JPG )
      4. Remove ID value and enter a value for Name
      5. Click Validate Form. (Name still remains in error state and ID doesnt show the error state- ValidateForm02.JPG)
      Expected behavior: The Name should not be highlighted and the ID should be highlighted
      Actual behavior: The Name is highlighted and the ID is not highlighted.

      6. Now if we click on the ID field the field gets highlighted(IDTextItemClick.JPG)
      7. Click on the Name field. The Name field gets updated to a non error state (NameTextItemClick.JPG)
      Attached Files

      Comment


        #4
        Thanks for the clarification.
        We've now made a change to address this issue. Please see the next nightly build (dated Oct 30 or above)

        Regards
        Isomorphic Software

        Comment

        Working...
        X