Solved

How to validate a Text Input inside a repeater?

Posted on 2011-02-25
6
808 Views
Last Modified: 2012-05-11
How to validate a Text Input inside a repeater? I Have few Text inputs inside a repeter. How to Validate them, or give required== true  when they are placed inside a repeater
0
Comment
Question by:FlexFresher11
  • 4
  • 2
6 Comments
 
LVL 17

Expert Comment

by:deepanjandas
ID: 34989993
Check this out, it uses a checkbox in repeater.

http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/

Warm Regards
Deepanjan Das
0
 
LVL 17

Expert Comment

by:deepanjandas
ID: 34989998
Also see the last example in this link:
http://livedocs.adobe.com/flex/3/html/help.html?content=repeater_3.html

Warm Re
gards
Deepanjan Das
0
 

Author Comment

by:FlexFresher11
ID: 35000405
Can you explain me with a code based example, where the textinput inside a repeater should be required.
How to set  required== true  
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 17

Expert Comment

by:deepanjandas
ID: 35003515
okie, I will try to put up a sample for your sometimes early tomorrow PST.

Warm Regards
Deepanjan Das
0
 
LVL 17

Accepted Solution

by:
deepanjandas earned 500 total points
ID: 35007044
Try this:
 
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
				layout="vertical"
				verticalAlign="middle"
				backgroundColor="white" viewSourceURL="srcview/index.html">
	
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.controls.CheckBox;
			
			private function onClickHandler(event:Event):void 
			{
				var idx:int;
				var len:int = arr.length;
				for (idx=0; idx<len; idx++) {
					if (textInput[idx].text == "" ) {
						status.text = "required field.";
						stage.focus = textInput[idx];
						break;
					}
				}
				status.text = "";
				Alert.show("submit data");
			}
			
		]]>
	</mx:Script>
	
	<mx:Array id="arr">
		<mx:Object label="Red" data="red" />
		<mx:Object label="Orange" data="haloOrange" />
		<mx:Object label="Yellow" data="yellow" />
		<mx:Object label="Green" data="haloGreen" />
		<mx:Object label="Blue" data="haloBlue" />
	</mx:Array>
	

	<mx:Panel id="panel" width="50%" paddingLeft="10" verticalGap="10">
		<mx:Repeater id="checkBoxRepeater" dataProvider="{arr}">
			<mx:TextInput id="textInput" />
		</mx:Repeater>
		<mx:ControlBar horizontalAlign="right">
			<mx:Label id="status" />
			<mx:Button id="button"
					   label="Click me"
					   emphasized="true"
					   click="onClickHandler(event);" />
		</mx:ControlBar>
	</mx:Panel>
	
</mx:Application>

Open in new window


Warm Regards
Deepanjan Das
0
 

Author Comment

by:FlexFresher11
ID: 35009995
Thank You it was really Helpful
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question