0

我已经用验证器创建了一个表单。每次代码运行到 label.text 或与 label.text 相关的函数时,都会弹出以下错误。以下错误是否意味着验证器有错误或 label.text 的默认值错误?


ReferenceError: Error #1069: Property Text not found on spark.components.TextInput and there is no default value.
    at mx.validators::Validator/getValueFromSource()[E:\dev\4.y\frameworks\projects\framework\src\mx\validators\Validator.as:980]
    at mx.validators::Validator/validate()[E:\dev\4.y\frameworks\projects\framework\src\mx\validators\Validator.as:940]
    at mx.validators::Validator/triggerHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\validators\Validator.as:1167]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
    at spark.components.supportClasses::SkinnableTextBase/textDisplay_valueCommitHandler()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:2743]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
    at spark.components::RichEditableText/set text()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\RichEditableText.as:2115]
    at spark.components.supportClasses::SkinnableTextBase/set text()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:1400]
    at spark.components::TextInput/set text()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\TextInput.as:280]
    at productDetailComp/onNew()[C:\Users\School\Adobe Flash Builder 4.6\FYPadminSideV3\src\productDetailComp.mxml:44]
    at productDetailComp/__newBut_click()[C:\Users\School\Adobe Flash Builder 4.6\FYPadminSideV3\src\productDetailComp.mxml:314]

4

1 回答 1

1

请注意,错误表示未找到属性“文本”(大写 T)。TextInput有一个text带有小写“t”的属性。

听起来您已将 配置Validator为验证不正确的属性名称。也就是说,你正在这样做:

<mx:Validator source="{myTextInput} property="Text" />

什么时候应该是这样的:

<mx:Validator source="{myTextInput} property="text" />
于 2012-09-20T05:08:29.177 回答