Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34941

Allow custom validators to use the triggerEvent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Apache Flex 4.14.1
    • Apache Flex 4.15.0
    • Validators
    • None

    Description

      The private triggerHandler() function only starts validation, without storing or using the event object. However, there are scenarios in which this object is crucial. For instance:

      There are two pathways to change the properties of an object: through a DataGrid itemEditor, and through a form, which are side by side. As a user I want to see in the grid when I have made an invalid change via the form.

      One cannot just add validators to the itemEditors in the grid, because they will not be instantiated if the changes happen via the form. But the red rectangle and errorString properties still need to be set when the wrong values are set.

      A solution is to have the renderers dispatch a custom bubbling event when their data changes, catch this event in a validator on the view that contains both the grid and the form, and set the source and property dynamically on the validator when this event occurs, so that it can effect the change to the border and errorString of the renderer. For this, however, we need the event object in triggerHandler.

      Attachments

        Activity

          People

            evolverine Mihai Chira
            evolverine Mihai Chira
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: