for creating the input boxes use createChild.

for collecting data from the rows i'd create an array index for each
child created and then collect the information for each item in the
array..

see code below...
hope this helps

ed

-----------
InputBoxes.mxml
----------
<?xml version="1.0" encoding="utf-8" ?>


<mx:HBox width="100%" height="25" 
xmlns:mx="http://www.macromedia.com/2003/mxml";>
<mx:Script>
        <![CDATA[
                public function getData() : String
                {
                        return column1.text + " / " + column2.text; 
                }
        ]]>
        </mx:Script>

        <mx:TextInput id="column1" width="250" text="input 1" />
        <mx:TextInput id="column2" width="250" text="input2"  />
                        
</mx:HBox>
        

-------
demo.mxml
-------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
        <mx:Script>
        <![CDATA[
        var rowArray : Object = new Array() ;
        var counter : Number = 0 ;
        private function addRow():Void
        {

                rowArray[counter]  =  InputBoxes( holder.createChild(InputBoxes,
undefined, null ) );
                counter++;
        }

        private function getData():Void
        {
                for(var x : Number = 0 ; x < rowArray.length; x++)
                {
                        output.text += rowArray[x].getData() + newline;
                }
        }
        ]]>
        </mx:Script>

        <mx:VBox id="holder"/>
        <mx:Button id="button1" label="add row" click="addRow();"/>
        <mx:Button id="button2" label="get data" click="getData();"/>

        <mx:TextArea id="output" width="300"  height="400" />
        
</mx:Application>
        



--- In [email protected], "rgwilson26" <[EMAIL PROTECTED]> wrote:
>
> I would like to dynamically create a row of text input boxes all 
> located within an HBOX. When the user clicks "add" button a new HBOX 
> containing all new text boxes will display below allowing for mulitple 
> rows of inputs. 
> 
> My question is: What is the best way to do this, and how do you 
> dynamically add muliple values to a Model to pass back to your 
> database? Does your model need to be dynamically created as well?
> 
> I appreciate any suggestions on this.
> 
> Thanks,
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to