So far the solutions proposed are good except for one thing!!
How to get saved a sub-component if I click anywhere on my apps (could be tree menu, buttons, etc).  The word "focus out" seems to be the best word to explain that but it is not doing what I need.
 
In the following example.  If I am in the Comp1 and I click on an item on the left tree...meaning that I am focussing out of the Comp1...how to get the Comp1 saved?
 
 
Thanks
 
<mx:HBox>
    <mx:Tree .../>
    <mx:Accordion>
        <mx:Form id="form1" label="Form One" hide="saveForm(1)">
            <comp:Comp1 id="comp1"/>
        </mx:Form>
        <mx:Form id="form2" label="Form Two" hide="saveForm(2)">
            <mx:Label text="1"></mx:Label>
        </mx:Form>
    </mx:Accordion>
</mx:HBox>
 

Ghislain Simard

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]On Behalf Of Philippe Maegerman
Sent: Thursday, August 25, 2005 3:40 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Accordion: save form on exit

You could also use your subComponents 'hide' events :
 
<mx:Accordion>
<mx:Form id="form1" label="Form One" hide="saveForm(1)">
   <mx:Label text="1"></mx:Label>
</mx:Form>
<mx:Form id="form2" label="Form Two" hide="saveForm(2)">
   <mx:Label text="1"></mx:Label>
</mx:Form>
</mx:Accordion>
 
 
Philippe Maegerman

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Abdul Qabiz
Sent: jeudi 25 août 2005 6:37
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Accordion: save form on exit

You mean, when another view(form) inside an Accordion is selected you
want to save the values in previously selected view(form)?

You can subscribe to Accordion's change event and do the appropriate.
Event object contains a propert(prevValue) which is zero-based index of
previously selected view inside the Accordion.


See the code below:-


<mx:Script>
      function saveForm(whichForm:Number)
      {
            switch(whichForm)
            {
                  case 0:
                        comp1.saveForm();
                  break;
                  case 1:
                        comp2.saveForm();
                  break;
            }
      }
</mx:Script>

<mx:Accordion change="saveForm(event.prevValue)">
<mx:Form id="form1" label="Form One">
   <comp:Comp1 id="comp1"/>
</mx:Form>
<mx:Form id="form2" label="Form Two">
   <comp:Comp2 id="comp2"/>
</mx:Form>
<mx:Accordion>



Comp1.mxml
function saveForm(){
saveRO.Save(myValues);//save values in the Database using RemoteObject
}


Hope it helps..


-abdul

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ghislain Simard
Sent: Thursday, August 25, 2005 4:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Accordion: save form on exit

how can we get the form values saved on exit of a stack of an
Accordion?  I have tried focusOut but no success.
I have a function inside each component (Comp1 and Comp2) which is
saving the values in a database.

<mx:Accordion >
<mx:Form id="form1" label="Form One">
   <comp:Comp1/>
</mx:Form>
<mx:Form id="form2" label="Form Two">
   <comp:Comp2/>
</mx:Form>
<mx:Accordion>

Comp1.mxml
function saveForm(){
saveRO.Save(myValues);//save values in the Database using RemoteObject
}






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







------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------



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




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to