【问题标题】:dynamic validators and itemrenderer动态验证器和 itemrenderer
【发布时间】:2011-05-30 12:26:59
【问题描述】:

我在我的应用程序中创建了一堆动态验证器。

我有一个包含 s:DataGroup 的 mxml。 DataGroup 包含一个 itemRenderer。 在这个 itemRenderer 中,我有一个想要验证的组合框。

我在 itemRenderer 的 creationComplete 上执行这样的验证:

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

当然,当我这样做时,itemrenderer 正在回收,验证器出现在我不希望它出现的地方。

有人知道我该如何解决这个问题吗?

谢谢, 杰米

【问题讨论】:

    标签: apache-flex itemrenderer validation


    【解决方案1】:

    为什么不验证selectedItemComboBox 并使用ComboBox 作为来源:

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

    【讨论】:

      猜你喜欢
      • 2012-01-21
      • 2018-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-09
      • 2010-12-21
      • 1970-01-01
      • 2012-09-15
      相关资源
      最近更新 更多