nihavend opened a new issue #738: Double component creation with state change
URL: https://github.com/apache/royale-asjs/issues/738
 
 
   There are tree states and the buttons change states on their label.
   
   
![image](https://user-images.githubusercontent.com/5983818/75443486-9047f480-5972-11ea-958b-380dd1efc1b3.png)
   
   **Case number one  :** 
   **WRONG** : Click on the login button to set state to "loggedInState" than 
the jobDetail button appears but when check the component view there are double 
components
   
   
![image](https://user-images.githubusercontent.com/5983818/75443854-575c4f80-5973-11ea-9aaa-91975e9e1b93.png)
   
   **Case number two :** 
   **CORRECT**:  Click on the AnaSayfa button  to set state to "anaSayfaState" 
than the jobDetail button appears but when check the component view there is 
single component
   
   
![image](https://user-images.githubusercontent.com/5983818/75444020-a86c4380-5973-11ea-931b-586383b7a495.png)
   
   **Case number two :** 
   **CORRECT**:  Click on the Logout button  to set state to "loggedOutState" 
than the jobDetail button disappears and the mainApp panel disappears.
   
   
![image](https://user-images.githubusercontent.com/5983818/75444052-b6ba5f80-5973-11ea-97a0-4d362a9a8e0d.png)
   
   Complete source : 
   
   ```
   <?xml version="1.0" encoding="latin5" ?>
   
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.apache.org/royale/spark"
                           xmlns:mx="library://ns.apache.org/royale/mx"
                           height="600" width="800"
                           currentState="loggedOutState">
   
        <s:states>
                <s:State name="loggedOutState"/>
                <s:State name="loggedInState"/>
                <s:State name="anaSayfaState"/>
                <s:State name="dummyState"/>
        </s:states>
        
        <fx:Script>
                <![CDATA[
   
                        
                        protected function 
button1_clickHandler(event:MouseEvent):void {
                                currentState = "loggedInState";
                        }
                        protected function 
button2_clickHandler(event:MouseEvent):void {
                                currentState = "anaSayfaState";
                        }
                        protected function 
button3_clickHandler(event:MouseEvent):void {
                                currentState = "loggedOutState";
                        }
                        
                ]]>
        </fx:Script>
        
        <s:layout>
                <s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" 
paddingTop="10" paddingBottom="20" />
        </s:layout>
        
        <s:Button id="button1" width="200" label="Login State" 
click="button1_clickHandler(event)"/>
        <s:Button id="button2" width="200" label="AnaSayfa State" 
click="button2_clickHandler(event)"/>
        <s:Button id="button3" width="200" label="Logout State" 
click="button3_clickHandler(event)"/>
        
        <s:Group id="mainApp" width="100%" height="100%" 
excludeFrom="loggedOutState, dummyState">
                <s:Button id="jobListDetail" width="200" 
label="jobdetail:JobListWithDetails" excludeFrom="anaSayfaState, 
jobDetailState, loggedOutState, dummyState" />
        </s:Group>
        
        
   </s:Application>
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to