Don't pull data from outside your component. Push outside data into your
component, but store it in data vars, not directly in the children. Then
when the children get created, have them pull data to display from those
data vars.
 
- Gordon

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of arieljake
Sent: Wednesday, May 02, 2007 11:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: weird accordion consequences



Thanks Tracy.

I know what you mean about repeated questions.

Problem with "pulling" data is that I don't want the Accordion
contents to be dependent on where they are getting their data. I would
rather the application be responsible for delegating connections
between components. Therefore, it will listen to events from child
components, and notify others when to respond.

I will set it to load children automatically. Thank you.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> I really need to have a boilerplate answer for this one!
> 
> The issue you describe is caused by the fact that Accordion and the
> other navigator containers by default use a feature called "deferred
> instantiation", where a child view is not rendered/instantiated until
a
> user first navigates to that view. 
> 
> Deferred instantiation helps to speed up the initial load of an
> application, improving the user's experience.
> 
> The correct way to handle this issue is to use data binding or your
own
> event system to "pull" data into the view when it is rendered, instead
> of trying to access members in the child view from "outside".
> 
> A quick an dirty fix, to determine if this is your p[roblem, is to set
> creationPoliccy="all" on the Accordion. But remember, this can hurt
the
> percieved performance of your app when the child vies become complex.
> 
> Tracy
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Ariel Jakobovits
> Sent: Wednesday, May 02, 2007 1:39 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] weird accordion consequences
> 
> I am adding an Accordion and am getting an error at runtime saying
that
> accessing a component located inside the Accordion by its id is null. 
> FlexBuilder shows no errors. 
> When I remove the accordion, all is fine.
> The code is posted below. Attempting to access
> stuffFilter.addEventListener is causing a null error.
> 
> <mx:Panel id="top_canvas" width="100%" height="100%" paddingLeft="5"
> paddingRight="5" paddingTop="5" paddingBottom="5">
> 
> 
> 
> <menus:GlobalMenu id="globalMenu" width="100%" />
> 
> 
> 
> <mx:HBox height="100%" width="100%">
> 
> 
> <mx:Accordion id="stuffSection">
> 
> <mx:VBox label="Stuff" width="100%" height="100%">
> 
> <trees:StuffTree id="stuffTree" width="100%"
> height="100%" />
> 
> </mx:VBox>
> 
> 
> 
> <mx:VBox label="Stuff Filter">
> 
> <form:StuffFilter id="stuffFilter" width="100%" />
> 
> </mx:VBox>
> 
> </mx:Accordion>
> 
> 
> <mx:VBox height="100%" width="60%">
> 
> <mx:Label width="100%" text="Details" />
> 
> <textarea:StuffDetail id="stuffDetail" width="100%"
> height="350" />
> 
> </mx:VBox>
> 
> </mx:HBox>
> 
> </mx:Panel>
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> 
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
<http://www.mail-archive.com/flexcoders%40yahoogroups.com>  
> Yahoo! Groups Links
>



 

Reply via email to