Is "submitForm_new" getting called? (trace, alert or debug)

I mistrust your way of referencing the function.

Try ms.core.Application.application.submitForm_new(zone_name.text)
instead.

Tracy

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Ghislain Simard
Sent: Thursday, July 14, 2005 2:24 PM
To: [email protected]
Subject: [flexcoders] Adding an item in a grid from a Popup

HI,
I would like to add, from a popup window, an item in a grid.  But 
it's not adding to the grid.  Any help would be great.  here is the 
code:

The grid:
      <mx:DataGrid id="tableauZones" 
dataProvider="{modelZones.zones.zone}" width="100%" height="100%" 
borderStyle="none">

The script:
        function popNewZone()
                {
                var parentToPopUpOver = this;
                var fc_submit:String;   
                var isModal:Boolean = true;
                var iniObj = {fc_submit:"submitForm_new"};
                
                var newPop:TitleWindow = TitleWindow
(mx.managers.PopUpManager.createPopUp
(parentToPopUpOver,popup.popup_new_zone,isModal,iniObj));
                newPop.move(250,200);
                }

        //SUBMIT FROM POP UP
        function submitForm_new(submitValue:String)
        {
                // CHECK DOUBLE NAME            
                tableauZones.addItem(submitValue);
        }

]]>
</mx:Script>

The popup:

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml"; 
autoLayout="true" title="Nouvelle instance de zone" 
closeButton="true"
width="325" height="160" click="this.deletePopUp();">
        <!-- SCRIPT -->
        <mx:Script>
        <![CDATA[
        
                import mx.containers.TitleWindow;
                import mx.containers.Panel;
                import mx.core.Application;
        
                var fc_submit:String;
                var oldLabel:String;
                function submitForm()
                {
                        if(zone_name.text != "")
                        {
                                this.parentApplication[fc_submit]
(zone_name.text);
                                this.deletePopUp();
                        }
                }
                
        ]]>
        </mx:Script>
        <!-- COMPONENT -->
    <mx:Canvas width="300" height="120" label="EN">
      <mx:Button label="OK" height="20" width="80" x="202" y="18" 
click="submitForm();"/>
      <mx:Button label="Annuler" width="80" x="202" y="48" 
click="this.deletePopUp();"/>
      <mx:Label text="Nom l'instance de la zone:" x="22" y="30" />
      <mx:TextInput x="22" y="58" id="zone_name"/>
    </mx:Canvas>
</mx:TitleWindow>




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



 







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