87682

how to validate textinput within itemrenderer?

Question:

I have textinput within list itemrenderer like

<strong>main.mxml</strong>

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

<strong>VideoAttachmentRenderer.as</strong>

<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 ?

Answer1:

override the set data method and trigger the validation in there

Recommend

  • Apache HttpClient able to communicate over HTTPS when DIRECT but not via PROXY error: javax.net.ssl.
  • How to get index of clicked element in Mootools
  • JavaScript mootools addEvent
  • DateTimeFormat.AbbreviatedMonthNames adding a dot at the end of month's name
  • Flex: DataGrid column formatting of numbers
  • Bootstrap 4 - Center List
  • Override Data Tip Circle
  • Cannot read property 'addEvent' of undefined
  • Add a div to replace Video after Video Plays Through
  • Are there any supported high bit-depth video or image formats in DirectShow
  • Converting raw frames into webm live stream
  • SIP API media codecs
  • (Tcl/Expect) clear screen after exit
  • Scanner nextInt() and hasNextInt() problems
  • jQuery: How to AJAXify WordPress Search?
  • Trying to get the char code of ENTER key
  • xcode don't localize specific strings
  • onBackPressed() not being executed
  • d3 v4 drag and drop with TypeScript
  • Swift: Switch statement fallthrough behavior
  • JQuery Internet Explorer and ajaxstop
  • Android fill_parent issue
  • java.lang.NoClassDefFoundError: com.parse.Parse$Configuration$Builder on below Lollipop versions
  • Why ng-show works with ng-repeat but ng-if doesn't? [duplicate]
  • Opengl-es onTouchEvents problem or a draw problem? [closed]
  • Which linear programming package should I use for high numbers of constraints and “warm starts” [clo
  • jquery mobile loadPage not working
  • Properly structure and highlight a GtkPopoverMenu using PyGObject
  • Data Validation Drop Down Box Arrow Disappearing
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • How do you join a server to an Active Directory (domain)?
  • Angular 2 constructor injection vs direct access
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • Linking SubReports Without LinkChild/LinkMaster
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?