如何验证itemrenderer中的textinput? [英] how to validate textinput within itemrenderer?

查看:98
本文介绍了如何验证itemrenderer中的textinput?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在

main.mxml

        <s:List
        id="videoAttachmentsList"  
        itemRenderer.normalView="com.engage.discussion.attachment.renderers.VideoAttachmentRenderer"
        >
 <mx:button  label="add"  click=addevent(Event) />

VideoAttachmentRenderer.as

 <TextInput  styleName="commonTextInput" 
                  prompt="Enter a video header"
                  id="headerText"
                  x="75" width="185" height="21"
                  bottom="5"
                  fontSize="10"
                  maxChars="30"/>
<fx:Declarations>
        <mx:StringValidator source="{headerText}" property="text" required="true" maxLength="30" requiredFieldError="Please enter video header"/>
    </fx:Declarations>

我的疑问是,当我单击(main.mxml)上的添加按钮时,是否需要验证headerText(Textinput)(VideoAttachmentRenderer.as).是否可以使用itemRenderer验证字符串.你能给些指导吗?

My doubts is when i click add button on (main.mxml) that time need validate headerText(Textinput)(VideoAttachmentRenderer.as) . is it possible to validate string withing itemRenderer. could u give any guidance ?

推荐答案

覆盖设置数据方法并在那里触发验证

override the set data method and trigger the validation in there

这篇关于如何验证itemrenderer中的textinput?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆