2011-05-30 31 views
0

我有一堆動態驗證器,我在我的應用程序中創建。動態驗證器和itemrenderer

我有一個包含s:DataGroup的mxml。 DataGroup包含一個itemRenderer。 在這個itemRenderer中,我有一個我想驗證的組合框。

我執行這樣的驗證ONT的itemRenderer的creationComplete:

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

當然,我這樣做的時候,的itemRenderer是循環使用,並驗證出現在地方,我不希望它至。

任何人有任何想法我可以解決這個問題?

感謝, 傑米

回答

2

爲什麼不來驗證ComboBoxselectedItem和使用ComboBox作爲源:

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