开发者

dynamic validators and itemrenderer

I have a bunch of dynamic validators that I create in my application.

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.

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

protected function creationCompleteHandler(event:FlexEvent):void
{
    var condition:Condition = data as Condition;
    condition.validator开发者_如何学Python.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


Why not to validate selectedItem of ComboBox and use ComboBox as a source:

protected function creationCompleteHandler(event:FlexEvent):void
{
    var condition:Condition = data as Condition;
    condition.validator.source = valuesComboBox;
    condition.validator.property= "selectedItem";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜