You could pass a reference of the Accordion to your component:
<sharedforms:Security id="secuirty" label="Product Security" owner="{accProduct}"/>
 
In your component, add a variable 'owner' and use it in your function :
<mx:Script>
<![CDATA[
    var owner; 
    // display the previous accordion
      function previousStep()
      {
            owner.selectedIndex -= 1;
      }
]]>
</mx:Script>
 
Philippe Maegerman
 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Malcolm
Sent: mardi 5 juillet 2005 6:20
To: [email protected]
Subject: [flexcoders] Accordion Navigation & Components

I need to share a number of forms & want to be able to navigate (set the
selectedIndex) of an accordion within a form called as a component. Basic
break down of code is as follows:

<!-- [Accordion.mxml] -->
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns:sharedforms="com.company.veiw.sharedforms.*">

<mx:Accordion id="accProduct">
     
      <mx:VBox label="Product Details">
            <!-- product details form here -->
      </mx:VBox>
     
      <!-- get the shared security form -->
      <sharedforms:Security id="secuirty" label="Product Security"/>
     
</mx:Accordion>

</mx:Application>

--------------------------------------------------------------------

<!-- [Securuty.mxml] -->
<?xml version="1.0" encoding="utf-8"?>

<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml">

<mx:Script>
<![CDATA[
      // display the previous accordion
      function previousStep(accordion)
      {
            accordion.selectedIndex -= 1;
      }
]]>
</mx:Script>

<mx:Button label="Previous Step" click="previousStep(super().accProduct)"/>

</mx:VBox>

The part I can't seem to get right is in the Securuty.mxml component. How do
I get it to navigate the parent accProduct accordion?

I have got has far as trying to call something like 'super().accProduct' but
it fails at runtime.

Since Securuty.mxml is a shared form it will also need to be free of any
specific accordion 'id', I assume I can pass accProduct when I instantiate
it?

Am I using the right approach here or do I need to create some sort of
form/accordion management class?

Thank you for any suggestions.

Regards,
Malcolm



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




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




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

Reply via email to