0 Replies Latest reply on May 30, 2011 5:36 AM by ihatescreenamesalot

    itemrenderer and validator

    ihatescreenamesalot Level 1

      Hi,

       

      I have a bunch of validators in my application that I create dynamically via actionscript.

       

      I have an mxml which contains a s:DataGroup.

      The DataGroup contains an itemRenderer.

      In this itemRenderer, I have a combobox which I want to validate with the dynamically created validators.

       

      I perform the validation like this on the creationComplete of the itemRenderer:

       

       

           protected function creationCompleteHandler(event:FlexEvent):void

           {

                var condition:Condition = data as Condition;

                if(condition.validator != null){

                     condition.validator.source = valuesComboBox.textInput;

                     condition.validator.property= "text";

                }

           }

       

      Of course, when I do this, the itemrenderer is recycling, and the validator appears in places in which i do not want it to.

       

      Anybody have any idea how i can work around this problem?

       

      Thanks,

      Jamie