> On the accordion tag, set creationPolicy=”all”.

 

> Setting a creationPolicy="All" on the accordian container will cause all of the "children" to be created when the accordian is created.

 

In my post two days ago I tried to explain why setting creationPolicy="all" is not The Right Way to solve problems caused by deferred instantiation. I'll try to work with our doc folks to do a better job of explaining the right technique in the future. In the meantime, here's a repeat of what I wrote then.

 

- Gordon

 

I'd like to suggest that it's better to learn how to make deferred

instantiation your friend than to simply turn it off.

 

The point of deferred instantiation is to not waste time at app startup

creating controls that you don't need yet. If you had a ViewStack with

500 views, it probably wouldn't be a good idea to create the controls on

all 500 of them at startup, when only one view is initially visible. The

only good reason to set creationPolicy="all", and therefore increase

startup time, is to decrease the small navigation delays when you switch

from view to view.

 

If these delays are acceptable, then you should allow the views to do

deferred creation of their controls, as they were designed to do.

 

So how do you set the initial state of controls that undergo deferred

instantiation? You use the appropriate events to set their state AFTER

they have been created. For example, you could use 'initialize' or

'creationComplete' events on the the controls themselves. Or you could

use events like 'childrenCreated' or 'childrenCreationComplete' on the

view that you navigated to.

 

Once you realize that every control in the app doesn't get created at

startup, it's always possible -- and not difficult -- to design your app

so that you don't push information prematurely into controls that don't

exist yet. Instead, it's typical to store information into a "data

model" of some kind that is independent of the controls that display

that information. When the controls get created, they pull the

information in from the data model.

 


From: [email protected] [mailto:[email protected]] On Behalf Of Gordon Smith
Sent: Thursday, October 13, 2005 12:57 PM
To: [email protected]
Subject: RE: [flexcoders] Any explanation as to why this would happen(Question about accordions)

 

This is due to a feature of Flex known as Deferred Instantiation.

 

My post on Tuesday entitled "Re: Unable to refer controls in Accordion !" addressed the issue.

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 11:42 AM
To: [email protected]
Subject: [flexcoders] Any explanation as to why this would happen(Question about accordions)

 

I am having some problems getting a button on one panel of an accordion to change the textinput box on another panel of an accordion and I was wondering if someone can give me some idea as to what could be causing this?

 





--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to