Change form control property in state : Form State « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » Form StateScreenshots 
Change form control property in state
Change form control property in state
          

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
        
        import mx.effects.easing.Bounce;
      
    </mx:Script>
    <mx:states>
        <mx:State name="bookDetails" basedOn="">
            <mx:AddChild relativeTo="{bookForm}" position="lastChild" creationPolicy="all">
                <mx:FormItem id="isbn" label="new Label" />
            </mx:AddChild>
            <mx:SetProperty target="{title}" name="text" value="New Details" />
            <mx:RemoveChild target="{bookLink}" />
        </mx:State>
    </mx:states>
    <mx:transitions>
        <mx:Transition fromState="*" toState="*">
            <mx:Parallel targets="{[book, bookLink, title, isbn]}">
                <mx:Resize duration="5000" easingFunction="Bounce.easeOut" />
            </mx:Parallel>
        </mx:Transition>
    </mx:transitions>
    <mx:Panel title="XML Book" id="book" horizontalScrollPolicy="off" verticalScrollPolicy="off">
        <mx:Form id="bookForm">
            <mx:FormItem label="Label 1" fontWeight="bold" /> 
            <mx:FormItem label="Label 2" fontStyle="italic" />
        </mx:Form>
        <mx:ControlBar>
            <mx:LinkButton label="Click" id="bookLink" click="currentState = 'bookDetails' " />
            <mx:Spacer width="100%" id="spacer1" />
            <mx:Label text="Title" id="title" />
        </mx:ControlBar>
    </mx:Panel>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Switch form stateSwitch form state
2.Set and get form stateSet and get form state
3.Add Form control in stateAdd Form control in state
4.Highlight new added form item during state changingHighlight new added form item during state changing
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.