2 Replies Latest reply on Oct 8, 2012 5:06 AM by beginner_39871238974

    validators run even when you hide tabs

    beginner_39871238974

      Another question about validators.

      It seems that even when you hide a tab with

      tabPanel.hideTabStripItem(tabIndex);

       

      all validators on the hidden tab are still running.

      Shouldn't all validators on fields that are not visible be automatically deactivated?

      Do we need to do this manually and if yes how?

       

      Thank you

      Nikolas

        • 1. Re: validators run even when you hide tabs
          Sham HC Level 7

          The dependency handling between form fields various from project to project & could not be provided by the system in a generic way to deactivate automatically.

          This can be solved at project level by implementing custom JS listeners and validators on the fields that have an effect on eachother.

          1 person found this helpful
          • 2. Re: validators run even when you hide tabs
            beginner_39871238974 Level 1

            This is what I did to solve the problem.

            Whenever I hide a tab, I remove all validators and whenever I unhide it I add the validators.

            I wanted to do this through listeners but since I couldn't find which event is fired (I tried everything and none of the documented ones is fired) I do this immediately after the hide/unhide action

             

            delete myfield.validator;

             

            and then later

            myfield.validator = this.validator_myfiled;

             

            validator_myfield is defined in the same namespace as

             

            validator_myfield : function(value) {

            ...

            }