Dispacting navigation events from creation complete.

Why does this event work if it's triggered from a button (Changing a viewstack event)
<<BUTTON CODE>>
<mx:Button id="linkToReg"
                               label="Need to Register?"
                              click="clickToRegistrationHandler(event)"
                               visible="{modelLocator.isNetworkAvailable &amp;&amp; modelLocator.adminId >0}"
                               includeInLayout="{modelLocator.isNetworkAvailable &amp;&amp; modelLocator.adminId >0}"
                               />
<<FUNCTION FOR BUTTON>>
protected function clickToRegistrationHandler(event:MouseEvent):void
dispatchEvent(new NavigationEvent(NavigationEvent.NEED_REGISTER));
But when I try to trigger the dispatchEvent from a completionComplete funtion it doesn't work?
<<CREATION COMPLETE TRIGGER>>
<views:LoginViewBase
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:views="com.merceradvisors.views.*"
    width="100%"
    height="100%"
    creationComplete="loginviewbase1_creationCompleteHandler(event)"
    >
<<CREATION COMPLETE FUNTION>>
protected function loginviewbase1_creationCompleteHandler(event:FlexEvent):void
                var sharedObj:SharedObject=SharedObject.getLocal("Login_Mercer")
                // here checking if the variable sored exists in shared object
                if(sharedObj.data.email!=undefined && sharedObj.data.password!="")
                    email.text=sharedObj.data.email;// adding the text value of the
                    password.text=sharedObj.data.password;// adding the text value of the login in the shared object
                trace("Triggered Successfully1");
                dispatchEvent(new NavigationEvent(NavigationEvent.NEED_REGISTER));
                trace("Triggered Successfully2");
This works just fine when triggered in a button and the viewstack changes, but when its programaticly triggered from creation complete it doesnt work.  Once I get this working I want to check a condition. if this then>>trigger this event
<<CREATION COMPLETE FUNTION WITH CONDITION>>
protected function loginviewbase1_creationCompleteHandler(event:FlexEvent):void
                var sharedObj:SharedObject=SharedObject.getLocal("Login_Mercer")
                // here checking if the variable sored exists in shared object
                if(sharedObj.data.email!=undefined && sharedObj.data.password!="")
                    email.text=sharedObj.data.email;// adding the text value of the
                    password.text=sharedObj.data.password;// adding the text value of the login in the shared object
                if(modelLocator.adminId == 0 )
                    dispatchEvent(new NavigationEvent(NavigationEvent.REGISTER_NEW));
                else
                    dispatchEvent(new NavigationEvent(NavigationEvent.LOGOUT));

Anyone?

Similar Messages

  • How to Prevent Navigating Away From a Page?

    Hi all,
    I�m developing a JSF application using IBM Rational Application Developer v6.0 and have this scenario:
    Background:
    I have a page that acts as a 3 step wizard. It also contains links to other pages. The page has a corresponding �pagecode� bean with a request scope and another managed bean with a session scope and basically everything happens here, all the action and action listeners. Also this managed bean handles three important events the �page load�, �page load ends�, and �page post�.
    Desired Behavior:
    I want to enforce the user to complete all three steps of the wizard without navigating away from this wizard like page by displaying a message �hey you must complete all three steps� or something like that :).
    Problem:
    The user can click on other links on the page and navigate away from the wizard without completing all three steps.
    Any suggestions to this issue would be of great help.
    Thanks in advance.

    First: how do I change my stupid screen name? :)
    Thanks for your solution. Would this also work for normal html navigation? My understanding that this may only work for the JSF framework navigation rules. On the other hand I also have plain html links on the page and not really sure if the JSF framework also handles these types of navigation.
    This maybe a partial solution though and I really appreciate this.
    Thanks.

  • How to trap navigation event?

    Anyone can help? I need to trap the navigation events, such as First, Last, Next and Previous? Does SBO have these event?

    Hi,
    In the UI API help file you have the complete list of the menu ID. The topic is "List of Menu Item IDs".
    You can also get the menuUID from SBO. Go to the systray and double click on the SBO icon. This will show a window. Whenever you make a click on SBO, the values on the window will be updated with the information about the clicked item.
    Regards,
    Ibai Peñ

  • Can't pass event from WebDynPro to JspDynPage - why?

    I Created JSP project and embedded in main page script (in its title),
    which subscribes to event by EPCM API,
    EPCM.subscribeEvent("urn:ru.intertech.common.wd.component", "save",   go);
    and created WebDynPro page that fires event using, when pressing on some bution:
    WDPortalEventing.fire("urn:ru.intertech.common.wd.component", "save", navUrl);
    but first code newer receives that event...
    why so ?
    for test reason I tested firing EPCM event on same JSP page,
    and it was received,
    also
    I tested receiving Portal event  "urn:com.sapportals:navigation", "Navigate"
    it was received on same JSP page.
    both iViews is not URL isolated according their properties.
    WebDynPro package is:
    package ru.intertech.common.wd.component;
    note from else people expirence:
    Does it important that receiving and firing side must be in same package? as written there:
    https://www.sdn.sap.com/irj/scn/thread?messageID=462647
    "The problem was that I created the Sender Application in package "com.sender" and the Receiver Application in "com.receiver".
    I created them in the same package and it works."
    What means domain for JSP page or WspDynPro component?
    Does it important?
    =================
    JSP code is (changed script formattin to be able to post here, and removed else business content):
    [hbj_content  ]
      [hbj_page_title"]
      [script_type="text/javascript__"]
      //alert["title started"];
      //EPCM.subscribeEvent["urn:com.sapportals:navigation", "Navigate", eventHandlingFunctionName]; 
      //EPCM.subscribeEvent["urn:ru.intertech.navigation:epcm", "Navigate", eventHandlingFunctionName]; 
      //EPCM.subscribeEvent["urn:ru.intertech.navigation:epcm", "Navigate",   pop];   
      //EPCMP.subscribeEvent[ "urn:ru.intertech.navigation:epcm", "Navigate", window,"eventHandlingFunctionName"];
        EPCM.subscribeEvent["urn:ru.intertech.common.wd.component", "save",   go];
         EPCM.subscribeEvent["urn:com.sapportals:navigation", "Navigate", eventHandlingFunctionName]; 
         EPCMPROXY.subscribeEvent["urn:ru.intertech.common.wd.component", "save"  , window,   go];
      function eventHandlingFunctionName[ eventObj ]
         alert["title started=" + eventObj.sourceId + ": " + eventObj.dataObject  ];
      function go[ evt ]
         alert["go started=" ];
      </script>
       <hbj:form id="myFormId" >

    your reply is worth.
    what is the domains for views on one page?
    where to see it?
    Also, standard SAP MDM controls which we are using not working under any other browser except IE,
    I tested on FF and Google Chrome, they do not erform dynamic part of the controls.
    Despite this, debugging of scripts is important thing, so every piece is worth.
    One more detail:
    Also, two such a controls do not receive events from each other,
    but ony within self..
    why so ?
    Edited by: Vladimir Grigoryev on Jan 27, 2009 10:00 AM

  • Send an event from Java Web Service to BPEL

    Hi,
    I have a requirement where from an Async BPEL service I have to call a Java Web Service. After the completion of its task Java Web Service will fire an event that has to be consumed by the BPEL to initiate further process. Can anybody help me with how to send an event from Java Web Service and at the same time consume it in BPEL?
    Thanks,
    Anuj

    See the following posts for your answer
    http://blogs.oracle.com/soabpm/entry/event_delivery_network_chapter
    http://blogs.oracle.com/soabpm/entry/using_the_event_api_to_publish
    http://guidoschmutz.wordpress.com/2010/01/12/using-the-event-api-to-publish-an-event-to-the-event-delivery-network-edn-the-spring-way/

  • Object does not match target type when raising an event from c# to VB6

    I have a c# .net DLL that I use from a VB6 app. It exposes an event,
    and the VB6 app is sinking it.
    The VB6 app is receiving the event, as long as it is raised from the
    main thread of the .net DLL.
    I have an aync task being handled inside the DLL (delegate BeginInvoke). Any
    attempt to raise the event from within that thread casuses the reported
    error, even from within the AsyncCallback function, when the thread is ending.
    I noticed that the delegate for the event is not declared inside the
    interface. It's in that module, but above the interface definition:
        [ComVisible(false)]
        public delegate void LoggingEventHandler( string logData );
    The event is declared in the class itself as:
        public class Processor : _Processor
            public event LoggingEventHandler        LogNotification;
    Finally, to raise the event:
    if ( this.Completed != null )
        this.Completed( true );
    If I open the tlb with OLEVIEW, I can see the public event just fine. Of course, I expected to, as it's working up until the helper thread kicks in.
    Now for the REAL WIERD PART! This DOES work on several servers that have
    been in production for months. It's just this one server that it won't work
    on. Same code. Resinstalled/registered it 1,000 times. It took me a while to
    find that an error was even occuring, since it was being raised in the
    seperate thread. In other words, I'm receiving the event just fine on a series of servers. This is a new machine we're trying to bring online. I suspect it's environmental, but I can't figure it out.
    I don't understand why the publisher would be expecting a certain type of
    subscriber in the first place... unless the error is really triggered by the client when the event reaches it. I've put logging into the client, though, and the first line of code inside the event is not being executed.
    For the VB6 app, I reference the tlb file that is automatically created when
    I compile (Interop is checked). I unregistered and re-registered the tlb on
    the server. I regasm'd the dll itself. All dlls are in the same folder - not
    in the GAC.
    The stack trace is as follows:
       at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
    culture, String[] namedParameters)
       at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
    CultureInfo culture, String[] namedParameters)
       at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
    msgData)
       at HPFS.Queue.IProcessorEvents.LogNotification(String logData))

    This is driving me nuts!
    I sure would appreciate any suggestions.
    I got this working on one of the two machines. The other machine had some other issues, so I had it re-imaged. It's been so long since I fixed the first one, that I can't remember exactly how I did it. Plus, I did so many things to it over two weeks, that I never really felt confident, anyway. But ... I could *swear* that the last thing I did back then to get this event to flow was to re-register the DLL's TLB.
    So ... This is win 2k with FW 1.1 + SP1.
    Completed is the delagate I'm trying to invoke.
    this.Completed.Target.GetType().Name = "__comobject"
    I've tried everything. Unregistered the .tlb. Unregistered the .net DLL. Verified that the app completely failed while unregistered. Created the TLB using RegAsm /tlb syntax.
    I tried using CLR SPY. It registers nothing. It only lets me pick an EXE. This is a DLL tring to raise to an EXE.
    I've looked at the TLB in OLE VIEW and I just don't know what I'm looking at.
    Is there any other tool or technique I can use to audit/monitor/trap this? .net is giving me *** for details about what's failing. I wish I could somehow debug into exactly what it's trying to do and get more details on the failure.
    Here's the error I'm getting:
    (Code -1) Object does not match target type.<Source:mscorlib>(Stack:    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
       at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
       at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
       at HPFS.Queue.IProcessorEvents.Completed(Boolean success)
       at HPFS.Queue.Processor.RequestDone())
    Processor = the DLL I'm trying to raise the event from.
    IProcessor = the event interface that's exposed through COM.

  • In downloading my Events from iPhoto on my Mac to my iPad Air, the Events arrive in the proper order but not showing the Key Photo.  At the same time, the Events arrive in iPhoto on the iPad in totally random order but showing the Key Photo.Why?

    In downloading my Events from iPhoto on my Mac to my Ipad Air, the Events arrive in Photos in the correct order but not showing the Key photo. At the same time, the Events arrive in iPhoto in a totally random order but with the Key phto showing. Why? of course and is there a way to shift the order in Iphoto and get a Key photo in Photos?

    HHi, thank you for the reply. I have checked my iPad and iPhone and neither has iCloud Photo Library (Beta) enabled. Turned off in both. Photostream is turned on.
    i tried to sort it out  by dragging all the photos to Events on the Mac and then deleting them from iCloud - (left hand side of iPhoto under the section 'Shared'). the photos now show up in Events. I did force quit but the issue remains. The message reads ' photos are bing imported to the library. Please wait for import to complete.'
    i can't empty iPhoto trash either. The message read "Delete error. Please wait for import to complete.'
    WHen I was moving the photos to the Events I always had a message about duplicates - to the effect that the photos already existed, did I want to import them? I clicked on Yes, import all duplicates. But when it showed the images - duplicates side by side - one showed the photo and the other was blank.
    I really don't know what to do! And I don't know how to handle my iOS devices. Is it to do with the large number of photos? Any help, advice appreciated.

  • Can we stop user navigating away from Block in an Error condition?

    Hi all,
    I am writing validation code in custom library attached to an Oracle Form. Is there any way to stop
    the user from navigating away from a Data Block if there is a validation failure?
    Many Thanks,
    Prathima.

    it depends. some triggers fire, before validations are complete, e.g. when-button-pressed. there is also a difference between navigable and non-navigable buttons/items.
    better you check it out by putting messages inside your code.

  • I had old 8mm converted to dvd then used "Rip It" then imported to iMovie. My problem: in the event library a complete person is shown, in the project the top of their head is missing. How can I fix?

    I had old 8mm movies converted to dvd. I then used "rip it" and imported to imovie. In the event library a complete person is shown on a clip. However, when I move that clip to the project the tops of peoples heads are missing in the playback. I have used standard (4:3) because the cut is lower in widescreen. How do I fix this problem?

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

  • How to set a specific width to all the TextInputs used in a mxml file on its creation complete?

    How to set a specific width to all the TextInputs used in a mxml file on its creation complete?

    Hi subhajit nag,
    I think the best approach would what I say is if you can make use of a Global variable or using a Singleton class having a variable which can be accessed globally through out the application.
    Below is the sample what I am talking to:
    So in below example you can access the variables textInputWidth and textInputHeight globally throghout the application since you have decalred them in main mxml file.
    You can access these variabled in another mxml file as Application.application.textInputWidth and Application.application.textInputHeight. So if at all you are required to modify these values you are only required to modify at a single place in main mxml file..thats it.
    If you are use any Singleton classes like ModelLocator you can place these variables in this class and refer from that class.
    Hope this resoved your problem..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script>
      <![CDATA[
       [Bindable]private var textInputWidth:int = 250;
       [Bindable]private var textInputHeight:int = 25;
      ]]>
    </mx:Script>
    <mx:Canvas id="canvas1">
      <mx:TextInput id="txt1" width="{textInputWidth}" height="{textInputHeight}"/> 
    </mx:Canvas>
    <mx:Canvas id="canvas2">
      <mx:TextInput id="txt2" width="{textInputWidth}" height="{textInputHeight}"/> 
    </mx:Canvas>
    <mx:Canvas id="canvas3">
      <mx:TextInput id="txt3" width="{textInputWidth}" height="{textInputHeight}"/> 
    </mx:Canvas>
    <mx:TextInput id="txt4" width="{textInputWidth}" height="{textInputHeight}"/>
    <mx:TextInput id="txt5" width="{textInputWidth}" height="{textInputHeight}"/>
    </mx:Application>
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari 

  • Pass Mouse click events from JavaScript to Falsh Movie

    Hi,
    I have an interesting problem here.
    i am trying to create a web page which has my
    flash-presentation movie. i need to disable mouse click &
    keyboard click navigation of the flash movie. The only way by which
    i can navigate my slide in the flash movie should be using 2
    buttons say Next & Prev that are i my web page.
    when i click the Next button i should be able to go to the
    next slid or the animation in the same slide like how i do in the
    power Point.
    Is there any way by which i can send these mouse click
    events from my javascript to my flash movie or is there any other
    means by which i can achieve this.
    ~Blackperil

    Hi Mathias,
    What i understood is that you want to triger a server side event (simulate onClick event of button)from a client side event (javascript confirm popup), based on the choice of user..
    You can also try this one...
    Check = confirm("Do you really want to proceed?");
    if (Check == true)
    document.getElementById('do_proceed').click();
    else
    document.getElementById('do_cancel').click();
    Regards,
    Anubhav

  • Events from iPhoto on my Mac wont sync to my iPad2 after upgrading to iOS8

    I recently updated to iOS8 on my iPad2.  During the update I got a message that the update failed and my iPad was stuck in Recovery Mode.  After Restoring my iPad2 and loading the most recent backup, I'm having issues with syncing all of my data back on the iPad.   I have the option selected to sync "Selected Events and Events from the past 12 months" to my iPad2.  After completing a sync, NONE of the events appear on my iPad.  The only photos that are available are in the Recent Photos's section.  I have tried syncing multiple times with no success.
    Any suggestions on how to get these events back on the iPad??
    Thank you for your time.
    Rick

    Well, now I'm really baffled. I've tried dragging the video to iTunes window and into the Movies folder. Nothing. I've tried File>Import to Library in iTunes. Nothing. I've dragged it over to the external hard drive where I keep iTunes and then drag it into the Movies folder there. Still nothing. I never get an error message from any of these methods, but I also do not have the video showing up. What the heck am I doing wrong?

  • Event from Migo

    Hi all,
    Migo trans. is not throwing any event in the system from which my WF can start. Moreover due to some issues, cannot have a Z-transaction for triggering an event...
    Now how to trigger an event from MIGO to start my Workflow...
    Please suggest...
    Thanks and Regards,
    Sudipto.

    Hi,
    I happened to be given a project to create an email when a Goods Receipt is posted using MIGO, so this thread came in handy.  I had just completed a similar project with Request for Quotation documents.
    For this project my steps where:
    1.  I created object ZMSEG with event 'Received'.
    2.  I created a Workflow to be triggered by event 'Received'.
    3.  I then implemented ZMB_DOCUMENT_BADI using method MB_DOCUMENT_UPDATE to trigger my event with SAP_WAPI_CREATE_EVENT.
    Everything worked fine.
    This is the first time I've postd and have had some great help from previous posts.
    Thanks for all of the BADI information.
    Larry M.

  • Dispatching an event from a command

    Hi,
    In one for my commands in the Cairngorm based application I'm working on I need to dispatch a event to amend the view. In my command I'm amending some value objects in a ArrayCollection, which is the data source for a List component in my view. Once I completed my changes to these value objects I'd like to dispatch a event to resort the ArrayCollection and update my view to the new order.
    What is the best approach for dispatching an event in the command?
    Thanks
    Stephen

    Great question - I'm currently sorting out how to do this myself.  I'm new to Cairngorm but have a decent amount of experience with Flex.  Here are my thoughts:
    Cairngorm promotes decoupling of the data model and front controller/commands from the view - which is appropriate for an MVC framework. Data binding supports this seperation (to an extent) and keeps the view up to date with the model in 'real time'.  Data binding does not however provide an intuitive mechanism for reacting to cairngorm event results.  So here a few solutions I've been tossing around:
    1.  Rely on Built in Flex events such as the datagrid's dataChange event to trigger a reaction.
    2.  Create view state variables in the model that, when changed through the front controller / commands, dispatch custom events from within their VO's / setters / ect.
    3.  Dispatch custom events directly from front controller / commands.
    4.  Create custom (or override existing) item renderers that self-transition / tween when changed as a result of data binding.
    I'm sure there are other ways to do what we want, but I'm out of ideas.  Which approach to take very well depends on how strongly you'd like to adhere to the MVC concept.  Commands that dispatch generic events as their messages may or may not be acceptable to you - but they provide a straitforward way to trigger view related reactions without relying on data binding events.  I'd be interested to know if Cairngorm 3 will address this challenge...
    Let me know what you decide on if and when you make a choice!

  • Fire event from within another event ?

    It seems that an event fired from within another event does not
    actually execute its code until the firing event completes. The fired
    event's Time value in its Event Data Node indicates the time that it
    was told to execute, but using GetTickCount calls shows that its code
    does not execute until the firing event is finished. This happens
    whether Value Signaling is used to generate a Value Change event or if
    CreateUserEvent and GenerateUserEvent is used. Is this because events
    are placed in a queue ? This behavior is different from Delphi for
    example where the fired event executes right away when called from the
    firing event (before the firing event completes).
    I have an event that executes upon a button value change. I would
    like that same event's code to execute when another button is pressed,
    but also have other code in the second button's event execute after
    that first button's event's code completes. Is there another way to
    accomplish this ?
    Steve

    > It seems that an event fired from within another event does not
    > actually execute its code until the firing event completes. The fired
    > event's Time value in its Event Data Node indicates the time that it
    > was told to execute, but using GetTickCount calls shows that its code
    > does not execute until the firing event is finished. This happens
    > whether Value Signaling is used to generate a Value Change event or if
    > CreateUserEvent and GenerateUserEvent is used. Is this because events
    > are placed in a queue ? This behavior is different from Delphi for
    > example where the fired event executes right away when called from the
    > firing event (before the firing event completes).
    I'm not that familiar with Delphi, but LV events are asynchronous.
    Window
    s OS has two ways of firing events, Send and Post. The LV events
    are always posted. The primary reason is that the LV events are handled
    by a node, not by a callback. The node you are calling is in the middle
    of a diagram, and reentering it not valid.
    > I have an event that executes upon a button value change. I would
    > like that same event's code to execute when another button is pressed,
    > but also have other code in the second button's event execute after
    > that first button's event's code completes. Is there another way to
    > accomplish this ?
    The best way to reuse code is to use subVIs. Firing events, or rather
    sending events is pretty close in other events to making a function call
    dispatched to anyone interested in the event. The event just hides who
    you are calling and makes you put your parameters in a funny format
    stuffed inside the event. IMO it also makes the code very hard to read
    since you don't know what calls what.
    Instead, just put the code into a sub
    VI and call it whenever you need
    to, from the event structure in one or more locations, and from other
    loops and diagrams.
    Greg McKaskle

Maybe you are looking for