Event Fired when a mxml component is shown on screen

hello,
I have following application structure nested up to 2/3 level.
Application
     linkbar connected to viewstack
     viewstack
          NavigatorContent
               mxml Component
          NavigatorContent
               mxml Component
mxml componet in turn has similar structure
componet
     linkbar connected to viewstack
     viewstack
          NavigatorContent
               mxml Component
          NavigatorContent
               mxml Component
and end component is form which is shown and actions performed
I want to execute specific code when the form is first time shown
which will collect data from server and will show for further actions.
User will edit/delete/update data with various button clicks.
I tried activate event on end component but it seems that it wont get
fired at all. End components are enclosed in BorderContainer or Group.
To test activate event I have used Alert.show only but popup is not shown
when I select link button on penutimate linkbar.
If I am doing something wrong please let me know as well please
guide me which event shall I use so that whenever linkbutton is
pressed on linkbar it will fire that event. In that event I can check
whether it has been called earlier by checking some variable which
will be null in creation complete and set in event fired when linkbutton is pressed.
Thanks and regards
Raja

I think 'creationComplete' is the closest event to what you are looking for.

Similar Messages

  • Add change event to a custom MXML component

    I am building an MXML project in Flash Builder 4.5
    I have a custom MXML component that contains a TextInput field. I want the custom component to have a change event that triggers a function in the main application.
    I created a test project to try and solve this.  At the moment, it appears to trigger an event once and then stops.  Please take a look and let me know where I am going wrong. Many thanks.
    customComponent.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
               width="40" height="20">
        <mx:Script>
        <![CDATA[
            [Bindable]
            public var value:Number;
            protected function inputBox_clickHandler(event:KeyboardEvent):void
                if (event.keyCode == 38 ) {
                    keyUp();
                if (event.keyCode == 40 ) {
                    keyDown();
            protected function keyUp():void
                value = value++;
                dispatchEvent(new Event('change'))
            protected function keyDown():void
                value = value--;
                dispatchEvent(new Event('change'))
        ]]>
    </mx:Script>
    <mx:Metadata>
        [Event(name="change", type="flash.events.Event")]
    </mx:Metadata>
    <mx:TextInput id="inputBox" x="0" y="0" width="40" height="20"
                  text="{value}"
                  keyDown="inputBox_clickHandler(event)"
                  change="dispatchEvent(new Event('change'))"
                  />
    </mx:Canvas>
    main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                xmlns:CustomComponents="CustomComponents.*"
                minWidth="955" minHeight="600" layout="absolute">
    <mx:Script>
        <![CDATA[
            private function changeTestLabel():void
                testLabel.text = String(myComponent.value);
        ]]>
    </mx:Script>
    <CustomComponents:customComponent x="180" y="183"
        id="myComponent" value="0"
        change="changeTestLabel()">
    </CustomComponents:customComponent>
    <mx:Label id="testLabel" x="165" y="206" text="Test label"/>
    </mx:Application>

    I have found the solution to this...
    The clue was that it worked the first time a change was made, changing the value to the default '0'.
    The problem was that the var value is type Number and the inputBox.text is type String.
    I therefore added the following function:
      protected function textChange():void
       value = Number(inputBox.text);
       dispatchEvent(new Event('change'))
    I also changed the  change="dispatchEvent(new Event('change'))"  property to
       valueCommit="textChange()"
    ... and that fixed it..
    Thanks to all those who took the trouble to look at this

  • SAP Cloud SDK : Make Display mode when open Embed Component in Account TI screen

    Hi Experts,
    I have created the custom business object and assign some fields into it.
    I have also assign some custom action into this custom business object. After that i have created the Embed component and and configured into Account_TI screen and its display data.
    Now when I open Any Account and go to that newly embed component in silverlight 2 options comes ( Save and Cancel ) to remove this options or to make display mode by default I have followed the below steps:
    1) Open Embed Component into UI designer.
    2) Go to Properties Window.
    3) In the top from the dropdown list select embed component.
    4) In the Property go to Configuration --> WorkProtectRelevant equal to false.
    5) After save and activate and check but still getting ( Save and Cancel ) option in embed component
    Is there any other solution or any other settings require to remove this ( Save and Cancel ) option.
    Regards,
    Mithun

    Hi Brad and Sumeet,
    Thanks for you reply on this post.
    In my requirement we do not want to save record anymore.
    Also my scenario : We have consuming the on-premise web service into c4c we have created the custom business object ( Not Screen) and based on this custom business object we have created the embed component and  design the screen to embed with Account_TI.
    We have Read the Account ID from Account _TI screen and assign to embed component element Alternative key AccountID.
    We have created of configured the embed component Inport to Read and Assign the Account ID as below:
    My Custom business object :
    businessobject ECC_recordBO {
      [AlternativeKey] [Label("Customer Number")] element AccountID : BusinessPartnerInternalID;
      element CtLimit : LANGUAGEINDEPENDENT_LONG_Text;
      element AvailCLimit : LANGUAGEINDEPENDENT_LONG_Text;
      element AccCurrency : CurrencyCode;
      action ViewAcc;
    My embed component InPort event :
    ReadEvent
    In ReadBOEvent I have add below actions:
    BO Operation
    Condition
    And under the condition I have use the below actions :
    To create BOOperation
    Second DataOperation as below :
    Assign AccountID from Account_TI to AccountID of embed component.
    Also once the user come into the Account_TI screen and go to embed component first its in display mode and when he click on any action under embed component its in edit mode but we do not want to save data anymore.
    Regards,
    Mithun

  • MediaPlayback - event fired when file not found?

    I want to have a playlist containing mp3 from multiple sites.
    I would like to use the MediaPlayback component to play these. If
    we try to play an mp3 that is not currently available we'd simply
    like to skip to the next mp3. I don't see any event or anyway to
    detect if a file was not found.
    We'll be using the "complete" event to know when to start the
    next mp3. Unfortunately this event it not fired in the scenario
    where the file is not available.
    Any suggestions (other than using the Sound object directly)?
    Thanks in advance.

    Hi,
           Refer these links for Java i\o operations.
    http://www.java2s.com/Code/Java/File-Input-Output/CatalogFile-Input-Output.htm
    http://download.oracle.com/javase/tutorial/essential/io/check.html
    http://www.roseindia.net/java/example/java/io/
    For java mapping help, pls search in sdn, you will find lots of helpful blogs
    Regards

  • REMOVED_FROM_STAGE event firing when it shouldn't...

    Hello everyone,
    Wondering if someone has seen this before. I have an application that has a few navigation points on the main timeline. The document class stops the movie at the first frame, and the "home" movieclip's class has Event.ADDED_TO_STAGE and Event.REMOVED_FROM_STAGE listeners on it. Funny thing is, it is calling the ADDED function as normal, then firing the REMOVED function immediately after. However, when I run it, it doesn't actually remove the movieclip from the stage. It is still there. When I navigate to a different section ("remote" or "assist") and navigate back to "home", it doesn't fire a second time, everything works properly after the first time.
    So I guess my question is, what would fire the REMOVED_FROM_STAGE event without actually removing the object from the stage? And why would it only happen once?
    Thanks for looking!
    -Nick
    Here is some code as well as a screen shot of my main timeline:
    package src.modules {
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import src.utils.greensock.TweenLite;
        import src.utils.greensock.easing.*;
        public class ModHome extends MovieClip {
            private static const DISTANCE:int = 700;
            private static const TWEEN_DURATION:Number = 1.0;
            private var _currentPage:int = 1;
            private var _isDone:Boolean = true;
            public function ModHome() {
                super();
    //            trace("home initialized");
                addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
            private function onAddedToStage(evt:Event):void {
                trace("home added to stage");
                removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
                addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage, false, 0, true);
                // BUTTONS
                pageLeft_btn.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);
                pageRight_btn.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);
            private function onRemovedFromStage(evt:Event):void {
                removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
                // BUTTONS
                pageLeft_btn.removeEventListener(MouseEvent.CLICK, onMouseClick);
                pageRight_btn.removeEventListener(MouseEvent.CLICK, onMouseClick);
    //            trace("home removed from stage");
            private function onMouseClick(evt:MouseEvent):void {
                if(_isDone) {
                    switch (evt.target.name) {
                        case "pageLeft_btn" :
                            movePages("left");
                            break;
                        case "pageRight_btn" :
                            movePages("right");
                            break;
                        default :
    //                        trace("home -- nothing");
                            break;
            // SCROLLING WINDOW
            private function movePages(thedirection:String):void {
                _isDone = false;
                var x1:int;
                switch (thedirection) {
                    case "right" :
                        if (_currentPage > 1) {
                            _currentPage = _currentPage - 1;
                            x1 = pages_mc.x + DISTANCE;
                            TweenLite.to(pages_mc, TWEEN_DURATION, {x:x1, ease:Quint.easeInOut, onComplete:onTweenComplete});
                        } else {
                            _isDone = true;
                        break;
                    case "left" :
                        if (_currentPage < 3) {
                            _currentPage = _currentPage + 1;
                            x1 = pages_mc.x - DISTANCE;
                            TweenLite.to(pages_mc, TWEEN_DURATION, {x:x1, ease:Quint.easeInOut, onComplete:onTweenComplete});
                        } else {
                            _isDone = true;
                        break;                   
            private function onTweenComplete():void {
                _isDone = true;
                pageMarker_mc.gotoAndStop(_currentPage);
    //            trace("complete");

    No reason in particular, when I created the class, FlashBuilder put it in there (I'm using Flash Pro CS5 + Flash Builder 4). I read that it calls it by default when the class is constructed, so having it in or out didn't really matter. I did comment it out with no luck, but I ended up shifting around the timeline quite a bit today and the problem has gone away. It seemed to only do it when it was in the first frame.
    Thanks for your help, I'm going to investigate it further when I have time just for reference, I'll post anything I find here.
    -Nick

  • Event firing when XML data is imported via Acrobat

    When a user in Acrobat imports xml data into a form, what event gets fired? I have a couple of actions that occur on change, but when I import xml into the form (to fill in values, etc), this event doesn't fire. Is it on initialize?

    Yea, I dug a little deeper and ended up using the initialize event. What I did was on the initialize event I execute the exit script. So it's the same as the user physically putting the value in. Plus, I dont have to have the same code in two places.
    In the initialize event code:
    myThingie.execEvent("exit");
    Pretty cool little function if you find it useful. Thanks for the reply.

  • [Javascript][Fixed-layout] - Is it an event fired when each page of the book is completely loaded ?

    Hi,
    everything is in the title.
    I want to set a page at the beginning of the book where the reader will have to wait until the book is fully loaded in iBooks.
    (A kind of onLoad event but for the whole book)
    This will be usefull to prevent lags when reading the fixed-layout epub.
    Thank you.

    Hi Oliboy50,
    I believe the iBooks app handles this for you.
    Are you able to use the DOMContentLoaded event listener like this to solve your problem? There is a function in ibooks.js to initialise all js, you could potentially add your functionality to that once iBooks as done the init. Have a look around line 200.
    window.addEventListener("DOMContentLoaded", function() {
        // Your code here
    }, false);
    Hope that hepls.
    Seb

  • Event in ActionScript Class not accessible by MXML Component

    I am implementing an ActionScript Class in my MXML Component,
    but it can't see the Event I'm specifying. I'm getting the
    following Error when I compile my application:
    Cannot resolve attribute 'myEvent' for component type
    myClass.
    How do I make the Event available to the MXML component?
    Thanks.

    Guess the compiler has a problem with semi-colons after the
    Event declarations. I removed the semi-colons, and was able to
    compile.

  • What business event executes when a Party is updated

    Hi,
    What business event executes when a Party is updated ?
    I tried with
    oracle.apps.ar.hz.Organization.update
    oracle.apps.ar.hz.CustomerProfile.update
    None of these seems triggering when Party information is updated example: Customer Profile, Customer Name itself.
    Thanks
    Saikrishna

    Please see if (Customers Workbench: No Business Event Firing When Activating/Inactivating An Account Contact (Doc ID 1553927.1)) helps.
    Thanks,
    Hussein

  • MXML Component Child Objects Loaded?

    I have a MXML component with various child components within. My question is:
    Are the child components initiated when the MXML component is initialized in AS (i.e. var instance:MyComponent = new MyComponent();)?
    The reason I'm asking this is because the child components are null after the component is initialized in AS when stepping through with the debugger.
    Thanks!
    Mike

    See creationPolicy, createChildren and references to deferred instantiation in the doc.  Children are not created in the constructor for performance reasons.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Capture event from mxml component

    I have an accordian control in my main mxml application. Each
    item in the control is a custom mxml component that I created that
    consists of a label and some text. When the label is clicked, I
    need to fire off a message to the containing application with a
    string value. I'm not sure how to do this. Here's what I have right
    now. I'm not sure if I'm going down the right track but if I am,
    how do I pass the string argument with the event and then capture
    this event and the argument in the main application?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="200">
    <mx:Script>
    <![CDATA[
    private var _title:String = "";
    private var _desc:String = "";
    [Inspectable(defaultValue=true)]
    public function set Title(title:String):void{
    _title = title;
    public function set Description(desc:String):void{
    _desc = desc;
    private function SetMovie(url:String):void{
    dispatchEvent(new Event("MovieTitle"));
    [Bindable(event="MovieTitle")]
    ]]>
    </mx:Script>
    <mx:VBox>
    <mx:Label id="lblTitle" text="{_title}" width="190"
    click="SetMovie('testmovie.flv');/>
    <mx:Text id="txtDescription" text="{_desc}"
    width="190"/>
    </mx:VBox>
    </mx:Canvas>

    You have several issues, and several options here. First, a
    custom event can pass any data you want, and is not very hard to
    create.
    However, there is a still easier way. All of the Event
    objects have a "target" and "currentTarget" property which give you
    a reference to the object that dispatched the event.
    So, in your component, implement a public property, say like
    this:
    public function get Title():String{
    return _title;
    then in a handler function you can do:
    private function onMovieTitle(event:Event):void {
    var sMovieTitle:String = event.currentTarget.Title; //watch
    out for reserved words, though
    There are two ways to listen for an event. One easy way is to
    use a bubbling event. Some folks advise against bubbling event
    because of potential event name collisions, but this may not be a
    concern for you. It has not yet concerned me enough to make me
    avoid using bubbling.
    The other way is to declare handler on the component itself.
    Also, if you use a metadata tag, you can assign the handler on the
    mxml tag, instead of using addEventListener():
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="200">
    <mx:Metadata>
    [Event(name="MovieTitle", type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    Then, in you main app:
    <myComp id="mc1" ... MovieTitle="onMovieTitle" ...
    Without the metadata, you would do
    mc1.addEventListener("MovieTitle",onMovieTitle)
    Using a bubbling event:
    change the dispatchEvent to this:
    dispatchEvent(new Event("MovieTitle",true)); //the 'true'
    makes it bubble
    Then, in the main app, listen ON the main app(this):
    this.addEventListener("MovieTitle",onMovieTitle);
    Tracy

  • How to add interface to customlize MXML Component when use Flex Builder 3?

    How to add interface to customlize MXML Component when use
    Flex Builder 3?

    David,
    I don't believe you can add the interface via the creation
    dialog in FlexBuilder 3. You can always manually add the
    "implements" property to your MXML Component root tag. Something
    like this: <mx:VBox implements="com.mycorp.IMyInterface">
    If you want autogeneration of the interface, then create an
    ActionScript class with that interface and then copy the generated
    functions and setter/getters into the script block of your MXML
    component.

  • Error when using instantiated mxml component in popupmanager

    Hi,
    Im getting the following error when trying to create a popup:
    Error #1007: Instantiation attempted on a non-constructor
    The code looks as follows
    var browserPop:CustomBrowser = new CustomBrowser();
    browserPop.targetType = "file";
    browserPop.fileType = "jpg";
    var pop:TitleWindow =
    PopUpManager.createPopUp(this,browserPop as Class, true) as
    TitleWindow;
    Where CustomBrowser is an MXML component extending
    TitleWindow.
    If i use:
    var pop:TitleWindow =
    PopUpManager.createPopUp(this,CustomBrowser, true) as TitleWindow;
    it works fine but i need to be able to set some public
    properties and therefore instantiate it first. Any help would be
    appreaciated.
    Thanks in advance
    Eric

    Create you component using the popupmanager, then cast it to
    the
    specific type to access it's public methods and/or variables.
    Like so for mxml component ExceptionPopup:
    var popup:IFlexDisplayObject;
    popup =
    PopUpManager.createPopUp(_parentPanel,ExceptionPopUp,true,null);
    (popup as ExceptionPopUp).addRecords(ev.errorMessage);
    (popup as ExceptionPopUp).title = "title";
    (popup as ExceptionPopUp).userText.text = "some user text"
    PopUpManager.centerPopUp(popup);

  • Which event will be fired when I after set JFrame.setVisible(false)

    Experts.
    I want to know which event will be fired when I after set JFrame.setVisible(false)?
    Because I need to check a thread is finished it job or not.
    I have checked windowClosing event, but it doesn't work.
    Thanks
    Francis

    Oh....
    Sorry, I find it will fired on componentHidden event.
    Very sorry.

  • Lync Phones Disconnect Events are Firing when a call is answered

    Im working with Lync client SDk 2013. I am trying to write a simple desktop application to determine when a call is Ringing, Answered, and Disconnected. I testing my application using Lync Desk phone (polycom phones). When i call my Lync phone, i get a "Notified"
    event, and when That call is answered, i get a "Disconnected" event.
    private static LyncClient _client;
    private static void Main()
    _client = LyncClient.GetClient();
    _client.ConversationManager.ConversationAdded += ConversationManager_ConversationAdded;
    _client.ConversationManager.ConversationRemoved += ConversationManager_ConversationRemoved;
    Console.ReadLine();
    static void ConversationManager_ConversationAdded(object sender, ConversationManagerEventArgs e)
    e.Conversation.Modalities[ModalityTypes.AudioVideo].ModalityStateChanged += Program_ModalityStateChanged;
    static void Program_ModalityStateChanged(object sender, ModalityStateChangedEventArgs e)
    Console.WriteLine("Modality state changed "+ String.Format("{0} => {1}", e.OldState, e.NewState));
    static void ConversationManager_ConversationRemoved(object sender, ConversationManagerEventArgs e)
    //....some code.
    }output from this code isModality state changed Disconnected => NotifiedModality state changed Notified=> DisconnectedI did come across few nice articles, but those don't seem to help me.http://blog.thoughtstuff.co.uk/2013/01/tracking-lync-conversations-in-code/http://msdn.microsoft.com/en-us/library/office/hh345194(v=office.14).aspxIs there any way to determine when the call is answered and disconnected?Thanks

    Hi,
    You might post the issue on Lync MSDN forum and more developing expert will help to verify if this can be achieved using Lync SDK. Thank you for your understanding.
    http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/threads
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

Maybe you are looking for

  • I got my itunes acount stolen and i need help i still got the resuce email and phone nomber on it with 490 usd in it

    had msg from apple saying i go change id then nothing sent on and it says desible account, so i guess someone stole my itunes acount and with all credit of 490 usd on it, and all i got is the rescue account and phone number which is mine and i can pr

  • BSP error when clicking on line item in SUS :Buffer table not up to date

    Hi Experts, I'm having a problem in SUS Portal. When i click on a line item of a PO to display the actual line item or see more details, i get a buffer table out of date error. I saw a thread with a similar issue where it says problem resolved but ha

  • Communication of XMII with XI

    Hi,     I would require your help for communication of XI with XMII I am getting PO data from R/3 which is required to be sent to xMII via XI. According to help this can be achieved via HTTP Receiver adapter Can anyone help me if XI can post request

  • New to the P45 Platinum

    Whew. That was a long day of trials and error for me to set up the motherboard. I feel really accomplished saying I put together my own computer for the first time. The story so far: Windows is loading okay, but ONLY on 1 stick of ram in slot 1, and

  • Can I get more data for free

    A sheet with my bill says I can "get more data for the same price".  Is this true and how do I do it?