I have textinput within list itemrenderer like
main.mxml
开发者_如何学JAVA <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 ?
override the set data method and trigger the validation in there
精彩评论