how to validate textinput within itemrenderer?

我的梦境 提交于 2019-12-11 08:45:49

问题


I have textinput within list itemrenderer like

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>

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 ?


回答1:


override the set data method and trigger the validation in there



来源:https://stackoverflow.com/questions/4992369/how-to-validate-textinput-within-itemrenderer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!