Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Highlighted
Developer
Posts: 63
Registered: ‎12-10-2012
My Device: Blackberry 9900
My Carrier: Vodafone-in

get data from dynamically created textinputs

[ Edited ]

Hai am having some dynamically generated textinputs i need to get values on button click 

Currently am having 2 issues

     1. get data from dynamically created textinputs on button click

     2. cannt scroll the dynamic container

This is how I add textinputs dynamically on button click

private function onAddButtonClick(event:MouseEvent):void
		{
			var subContainer:Container = new Container();			
			subContainer.width = 768;
			subContainer.height = 500;
			
			subLayout = new GridLayout(2);			
			subLayout.numColumns = 2;
			subLayout.hSpacing = 100;
			subLayout.vSpacing = 20;			
			
			textinput = new TextInput();		
			
			var deleteImage:Image = new Image();
			deleteImage.setImage("images/aboutIconblack.png");			
			deleteImage.addEventListener(MouseEvent.CLICK, onDeleteImageClick);
			
			subContainer.addChild(tiput);
			subContainer.addChild(deleteImage);
			subContainer.layout = subLayout;
			mainContainerDTL.addChild(subContainer);
		
			function onDeleteImageClick(event:MouseEvent):void
			{
				trace(subContainer.numChildren);
				mainContainerDTL.removeChild(subContainer);
				
			}
		}

 how to get values from text inputs. When i try to get value I oly get the value/data from last created textinput

 

Any help is appreciated

Thanks in Advance :-)

 

 

_______________________________________________________
Help is available everywhere but you have to look at the correct place.
By Me :-)
Trusted Contributor
Posts: 110
Registered: ‎03-07-2013
My Device: -
My Carrier: -

Re: get data from dynamically created textinputs

I'd suggest pushing those textInputs into an array. Something like this:

 

private var allTextInputs:Array = new Array();

private function onAddButtonClick(event:MouseEvent):void

{

//..blabla

allTextInputs.push(textInput);

}