On Wed, Dec 24, 2008 at 9:42 PM, Sergey Kovalyov
<[email protected]> wrote:

> Long time ago I have asked the question regarding commitProperties()
> implementation in the container that might be a navigation container child:
> http://www.mail-archive.com/[email protected]/msg47993.html
>
> Unfortunately, I have not got any answer.
>
> Though we, in our team, use kind of workaround:
>
>  override protected function commitProperties() : void {
>  super.commitProperties();
>
>  if (processedDescriptors) {
>   // Do all properties deferred processing here.
>  } else {
>   _commitPropertiesPostponed = true;
>  }
> }
>
> ...
>
> private function onInitialize() : void {
>  if (_commitPropertiesPostponed)  {
>   _commitPropertiesPostponed = false;
>   invalidateProperties();
>  }
> }
> Thus if the commitProperties() is executing and there are no children
> created yet (this happens for navigation containers childrent and can be
> verified via processedDescriptors), we set the _commitPropertiesPostponed
> flag to true and then in initialize event handler reset it and call
> invalidateProperties() to execute commitProperties() once again.

You don't need the _commitPropertiesPostponed flag there. On your
initialize event, you can just generally call invalidateProperties.

For the scenario you've described here, the best practice I would
recommend is to always check for the processedDescriptors flag and
always call invalidateProperties, invalidateSize, and
invalidateDisplayList (all three) in the initialize handler.

-- 
manishjethani.com

Reply via email to