[ 
https://issues.apache.org/jira/browse/FLEX-33922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839081#comment-13839081
 ] 

Alex Harui commented on FLEX-33922:
-----------------------------------

ValidateNow() shouldn't hang the browser.  It is a bit strange that you need it 
at the end of a function.  It is more commonly used when you need code to run 
after calling it.

When validateNow() hangs, it is usually because there is an invalidation loop.  
As some thing is validated, it invalidates itself or something else which ends 
up invalidating the original thing and the system never completes.  You can 
debug it yourself by looking at the objects being validated in LayoutManager.  
If you start seeing the same object over and over again you can try to 
understand why it keeps getting invalidated.  I usually do this by setting 
breakpoints on LayoutManager's invalidateXXX() methods.  The call stack should 
tell you why it keeps getting invalidated.

> validateNow() Freezes the browser
> ---------------------------------
>
>                 Key: FLEX-33922
>                 URL: https://issues.apache.org/jira/browse/FLEX-33922
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: Box View
>    Affects Versions: Apache Flex 4.9.0, Apache Flex 4.10.0, Apache Flex 
> 4.11.0, Apache Flex 4.12.0
>         Environment: Windows 8, tested on Chrome, Mozilla and Internet 
> Explorer
>            Reporter: Thiago Maia
>
> Whats happen:
>   When try to set a color for a vbox background and activate it, it will 
> froze.
>   Can be tested on this link;
> http://www.a00s.com/teste2013/vbox/TesteVbox.html
>   Project for Eclipse is here
> http://www.a00s.com/teste2013/vbox/TesteVbox.rar
> Expected;
>   Vbox activated for use
> -------------------------------------------------------------------
> This sequence make it freezes
> currentVBox3.setStyle('backgroundColor',0x003300);
> then enable a disable VBox
> currentVBox4.enabled = true;
> then validate
> TelaLocal.validateNow();
> or
> this.validateNow();
> below the full code:
> TesteVBox.mxml
> ------------------------------------------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
>                          xmlns:s="library://ns.adobe.com/flex/spark" 
>                          xmlns:mx="library://ns.adobe.com/flex/mx" 
>                          minWidth="955" minHeight="600">
>       <fx:Script>
>               <![CDATA[
>                       import mx.containers.VBox;
>                       private function testing():void {                       
>                               var newVBox:VBox = new VBox();
>                               newVBox.label = "aa";   
>                               newVBox.id = "aa";                              
>                                 
>                               TelaLocal.addChild(newVBox);
>                               
>                               var newVBox2:VBox = new VBox();
>                               newVBox2.label = "bb";  
>                               newVBox2.id = "bb";                             
>                                 
>                               newVBox2.enabled = false;
>                               TelaLocal.addChild(newVBox2);
>                               
>                               var formChildren3:Array = 
> TelaLocal.getChildren();
>                               for each(var currentVBox3:VBox in 
> formChildren3){                               
>                                       
> currentVBox3.setStyle('backgroundColor',0x003300);
>                               }                               
>                       }
>                       private function testing2():void {                      
>                               var formChildren4:Array = 
> TelaLocal.getChildren();
>                               for each(var currentVBox4:VBox in 
> formChildren4){
>                                       currentVBox4.enabled = true;            
>                 
>                               }
>                               TelaLocal.validateNow(); // or 
> this.validateNow();
>                       }
>               ]]>
>       </fx:Script>    
>       <mx:TabNavigator id="TelaLocal" width="100%" height="100%"/>
>       <s:Button x="201" y="73.1" label="1) Press first here" id="aaaaaaa" 
> click="{testing()}" width="150"/>
>       <s:Button x="401" y="73.1" label="2) Then here" id="bbbbbbb" 
> click="{testing2()}" width="150"/>
>       <s:TextInput x="201" y="120" width="100">       </s:TextInput>
>       <s:TextInput x="201" y="180" width="100">       </s:TextInput>
>       <s:TextInput x="201" y="220" width="100">       </s:TextInput>
> </s:Application>



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to