Passing a parameter to a custom event?

OK, I almost have this figured out, but there's always a part that escapes me.

I have a component that will dispatch a custom event 'ImageClicked' (see code). The component instance has a string variable ' var link: String. I pass a string of binding to this element when it is created, such as the purpose, say that the value is "" http://www.adobe.com ". "

I want to raise this event to the main application and not the value of 'link' with the event, so my request then go to the Adobe homepage (in this example).

I then this event listener: mainStack.addEventListener (ImageClicked.CLICK, goLink);

My goLink function expects a string parameter, the value of 'link' in the component, in this case, I wish it were " http://www.adobe.com".

Can someone please clear this up for me? I feel like I'm so close, but it is missing a key ingredient

Here is one approach. Let us know if this does not work in your situation.

Tags: Flex

Similar Questions

  • Pass a parameter for the custom component - get null

    Main MXML (part of the code):

    < s:Application

    "" xmlns:ns1 = "*".

    creationComplete = "init (); >

    import MyComponent;

    private function init (): void {}

    var myArray:Array is ["FFF", "TT", "RRR"];.

    myComp.width = 200;

    myComp.height = 200;

    myComp.getArray = myArray;

    myContainer.rawChildren.addChild (myComp);

    }

    < fx:Declarations >

    < ns1:MyComponent id = "myComp" x = "0" y = "0" / >

    < / fx:Declarations >

    custom component:

    package 
    {
              public var getArray:Array;
    public class MyComponent extends Sprite { } trace (getArray); trace null
    }
    }

    What is myContainer?

    I have a working version with my container as UICOmponent inside the hand.

    SerializableAttribute public class MyComp extends Sprite

    {

    private var _getArray:Array;

    public void MyComp()

    {

    }

    public function get getArray (): Array

    {

    Return _getArray;

    }

    public function set getArray(value:Array):void

    {

    trace ("setter", value);

    _getArray = value;

    }

    }

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx".

    "" xmlns:NS1 = "*".

    minWidth = "955" = "600" minHeight

    creationComplete = "init (); » >

    private function init (): void {}

    var myArray:Array is ["FFF", "TT", "RRR"];.

    myComp.width = 200;

    myComp.height = 200;

    myComp.getArray = myArray;

    myContainer.addChild (myComp);

    }

    ]]>

    Not sure whether what you are after but it traces:

    Setter FFF TTT, RRR

    Why do you add to rawChildren?

    C

  • passing the parameter through links page (navigation)

    Hello

    suggest me the way to pass the parameter through links in the page navigation.

    I tried it in EL, I'm not able to get on the page.

    is it a right approach or any other.

    Thank you

    A

    After showing the steps in the similar thread, I found this thread then re-post here.

    Pass the connection parameter to connected in portal Builder page


    Here are the steps to pass the parameter in a URL to another page:

    OR

    Sign in to your personalized Portal (say MyPortal1)

    http://127.0.0.1:8888 / webcenter/Portal/MyPortal1

    Click the settings (e.g. Pages & portals Actions)-> manage-> all settings

    It will take you to the page view of all of the current portal (i.e. MyPortal1).

    Then click attributes in the left pane, and you can create/edit/delete the custom attributes for the current portal on the right side.

    • Click Add an attribute and specify the following information:

    Attribute name = myvar

    This is the attribute that we will refer to any page using the EL "MyVar".

    Attribute value = #{param.myvarval}

    "Myvarval" is the name of the query parameter (i.e. suffix query param & myvarval = TestSuccess will be passed as part of the URL later)

    • Now, create a new page "TestPage" and add the element of HTML markup on the page using the composer.
    • In the Properties window, change the HTML markup element.

    Replace the existing value

    #{componentExtensionBundle.OUTPUT_TEXT_TEXT}

    with

    #{spaceContext.currentSpace.metadata.customAttributes ['myvar']}

    • Click apply and then click OK to close the pop-up window.
    • Click on save and view Portal


    • CHECK: Replace/change the URL the following OR open in a new tab in the browser

    Http://127.0.0.1:8888 / webcenter, portal, MyPortal1, TestPage ? myvarval = TestSuccess

    and you will see "TestSuccess' message in the"TestPage"rendered using the HTML markup component.

    This confirms passing the parameter to a page URL works as expected.

    Now, to add a link to the "TestPage" passing a parameter in the URL of the page in another page (Home Page say).

    • Now goto homepage, correct it in composer and add the hyperlink element. Click change to set the hyperlink in the Properties window.
    1. Set the title to display (i.e. the value of the title TestPage)
    2. Set the Destination URL by clicking on the search icon and choose "TestPage".

    Destination is defined with values that resembles

    /faces/Oracle/WebCenter/page/scopedMD/sf5926dd1_9e6a_45ab_a99c_d79fabb362c0/Page1.JSPX

    Add a suffix '& myvarval = TestWorks' to him.

    • Click apply & OK.
    • Click on save and view Portal
    • CHECK: Since your home portal or the home page, click on the link "TestPage" which brings you to the TestPage and you will see "TestWorks' message in the"TestPage"rendered using the HTML markup component.

    I hope it helps.

    References:

    How to pass a parameter of argument the query URL to a parameter input workflow? (Doc ID 1545808.1)

    https://mosemp.us.Oracle.com/epmos/faces/DocumentDisplay?ID=1545808.1

    Works with the global attributes in portals

    http://docs.Oracle.com/CD/E29542_01/WebCenter.1111/e27738/wcadm_ps_attrib.htm#WCADM11701

  • Custom event listener callback fails

    Hello

    I have a mobile project Flex 4.6 and I created a custom event, I can see different tracks that the event is currently distributed as planned, but no matter what I do I cannot get a listener to the work that they just sit there and nothing ever happen, please take a look and tell me what might be wrong.

    Custom event:

    package classes.events

    {

    import flash.events.Event;

    SerializableAttribute public class cartLoaded extends Event

    {

    public static const = "cartLoadSuccess" CART_LOAD_SUCCESS:String

    public void cartLoaded (type: String, bubbles: Boolean = false, cancelable: Boolean = false)

    {

    trace ("event_dispatched");

    Super (type, bubbles, cancelable);

    }

    override public function clone (): event

    {

    trace ("event_cloned");

    return new cartLoaded (type, bubbles, cancelable);

    }

    }

    }

    The event is dispatched to a class, after a ResultEvent returned by a Web service call, so in the ResultEvent reminder I have:

    var cl: cartLoaded = new cartLoaded (cartLoaded.CART_LOAD_SUCCESS);

    e.currentTarget.dispatchEvent (cl);

    And I see "event_dispatched" in the console when my results come back. So, I know that the event is triggered. Now on the file of main Application in the ViewInit on a list, on a view that I add, I have almost tried this anywhere.

    lst_cart.addEventListener (cartLoaded.CART_LOAD_SUCCESS, LoadData);

    function loadData(e:cartLoaded):void

    {

    trace ("data set provider");

    }

    I never see "set the data provider, now I understand that the listener must be saved before the event is dispatched, and in my case, it certainly is:

    I have a vision (tried to addEventListener here in an initialization handler)

    the view contains a list with a custom converter (tried here)

    the itemrenderer contains a button (have tried here)

    the button calls a method in a class that raises a web service call (this is where the event to send)

    the web service call triggers a result event

    the result event is triggered my custom event

    Please help, because it is seriously holding me back, I have to be able to capture this event, and I've tried everything.

    Concerning

    Shaine

    Post edited by: sfisher_sticky_kiwi

    Pauleta is true that there is a loss in the case of the chain, like the wrapper it cannot listen on the list because the list itself is not part of the hierarchy of the event.

    I think you can get around this in two ways.

    1. Have your Cart class extend the EventDispatcher class. If this is not possible at least implement IEventDispatcher interface and have a composite object that is the event dispatcher. Anyway, given the class cart is a form of an event dispatcher.
    2. Have your item converter listen directly to the event on the Cart class.
    3. Your event handler converters, to ship another event that spreads to the top of the display object hierarchy.

    Something like this:

    public class Cart extends EventDispatcher
    {
         public function doStuff() : void
         {
              ...
              dispatchEvent(...);
         }
    }
    
    OR if you can't extend it
    
    public class Cart implements IEventDispatcher
    {
         private var _eventDispatcher:EventDispatcher;
         //contains all the methods of the IEventDispatcher interface but uses a facade layer
         public function Cart()
         {
              _eventDispatcher = new EventDispatcher();
         }
    
         public function addEventListener(params...) : void
         {
              _eventDispatcher.addEventListener(params...);
         }
    
         public function doStuff() : void
         {
              ...
              _eventDispatcher.dispatchEvent(...);
         }
    }
    
    public class MyItemRenderer
    {
         public function buttonClick() : void
         {
              var cart:Cart = new Cart();
              cart.addEventListenerer(...);
              cart.doStuff();
         }
    
         public function doStuffEventListener(event:Event) : void
         {
              //Make sure the bubbles property is set to true
              dispatchEvent(event.clone());
         }
    }
    

    This should ensure that the event now on the queue from the list view... If she is probably not a good idea to constantly be adding some that this event listeners, it is probably better just to have a callback function and pass it to point converters to pass based on the cart process.

  • Ask by writing a Custom Event class

    Hello

    I'm working with events for pratic epurposes, when I copy, paste the web tutorilas code they work Flory, but whne I try myself that they do not work.

    Please help me

    It's my Custom Event.

    I want to pass the VO object by event. If please see this code below and let me know that where I am doing wrong.


    package events
    {
    import flash.events.Event;

    import Vos. User;
    SerializableAttribute public class LoginEvent extends Event
    {
    public static const = "LoginEvent"; LOGIN_EVENT:String
    public var user: user;

    public void LoginEvent(type:String,user:User)
    {
    Super (type, User);
    This.User = user;
    }
    }
    }

    Please let me know

    What are the parameters to be passed within the constructor of the event class and the parameters inside the super()

    Waiting for your answers.

    When you call super(type,user), you pass an object of type User to the event class where its actually expects a Boolean value for the value of bubbles.

    Just call super (type), if you do not cancel/bubble

  • Management of the custom event sent by loading SWF fails

    I loaded and SWF using SWFLoader. Not a component, but just a regular Flash AS3 SWF. I can access its properties and functions but when I listen to a custom, event distributes, I get the error:

    Error #1034: Type coercion failed: cannot convert com.subhumanmedia.classes::SoundCueEvent@911ad61 to com.subhumanmedia.classes.SoundCueEvent.

    Here's the event:
    package com.subhumanmedia.classes
    {
    import flash.events.Event;
    SerializableAttribute public class SoundCueEvent extends Event
    {
    public static const = "cueSound" CUE_SOUND:String

    private var soundCueObjectInstance:Object;

    public void SoundCueEvent (type: String, bubbles: Boolean, cancelable: Boolean, soundCueObject:Object)
    {
    parameter soundCueObject:
    soundCueObject.cueSoundURL is the string with the name of file to play
    soundCueObject.cueSoundStartTime is the number giving the millisecond offset to read from
    //
    Super (type, bubbles, cancelable);
    soundCueObjectInstance = soundCueObject;
    }
    public function get soundCueObject (): Object
    {
    Return soundCueObjectInstance;
    }
    override public function clone (): event
    {
    return new SoundCueEvent (type, bubbles, cancelable, soundCueObjectInstance);
    }
    }
    }

    Here is the statement in the loaded SWF, the event:
    dispatchEvent (new SoundCueEvent (SoundCueEvent.CUE_SOUND, true, false, soundCues [cueCounter]));


    soundCues is an attay soundCueObjects.

    Here is the definition of the listener in my main class:
    slide.slideGraphic.swfObject.content.addEventListener (SoundCueEvent.CUE_SOUND, cueSoundHandler);

    And here's the Manager:
    private void cueSoundHandler(e:SoundCueEvent):void
    {
    trace (e);
    }

    If I change the type of parameter of the event Manager, it does not take a mistake, but I can't yet ride a SoundCueEvent event in order to obtain tracking information.

    Now both the right loaded SWF and main class get the definition of the event from a compiled SWC, but I tried several other ways to do it without any better result.

    I don't know even what causes the error and am totally baffled by how to solve it. Can anyone help?

    It is equivalent to the problem of shared code described in the presentation of the modules on my blog.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • ITEM_INSTANCE when handling WHEN-POINT-CUSTOM-EVENT in a block of several record?

    I want to manage the trigger WHEN-POINT-CUSTOM-EVENT of a Bean in a block of several record. The PROPERTY_CHANGED_EVENT doesn't give me that the name of the property that has changed in the parameter of DATA [1], apparently expected to make a later FBEAN. GET_PROPERTY to discover the current value [2].

    However, how does my trigger know that ITEM_INSTANCE be read?
    // how do I find 'instanceWhichCausedTriggerToFire' ?!
    FBean.Get_Property('myBeanArea', instanceWhichCausedTriggerToFire, myPropertyName);
    I use 10g R2 for development.

    Thanks for sorting out my confusion!
    David Bullock

    --
    [1] [working with Data Type and events encoders | http://www.oracle.com/webapps/online-help/forms/10g/state/content/navId.3/navSetId._/vtTopicFile.enhancedjavabean | enjbs_workwithencoders ~ html /]
    [2] Grr...

    Hello

    As second instance element built-in parameter, you can use the Get_Block_Property ('block_name', CURRENT_RECORD)

    François

  • Pass the parameter to the javascript application process

    I'm trying to pass a parameter to an application process from javascript and don't know how to do this. What I want to accomplish is to create checkboxes to delete several records at once. Before these records can be deleted, I need to make sure that the resource_type_id is not used. To do this, I call a javascript function with an onchange event that calls an application process to perform a database search. I have included the code to create the boxes and the JavaScript below. I am new to APEX, so there may be a way easier and better to do. Any help or suggestion about a better way to proceed would be appreciated.

    Thank you!

    Creation of boxes *.

    SELECT APEX_ITEM. CHECKBOX (20, RESOURCE_TYPE_ID, 'onchange = "CheckUsed (this.value)" '; ':') "Delete", RESOURCE_TYPE, APEX_ITEM.text(10,RESOURCE_TYPE_ID) RESOURCE_TYPE_ID
    OF resource_types
    ORDER BY RESOURCE_TYPE



    < script language = "JavaScript1.1" type = "text/javascript" >
    function CheckUsed (id)
    {

    get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is ResourcesResourceTypeExists', 0);

    Alert (Get.get ());
    }

    NP, help!

    Andy

  • Dynamically Open VI and him pass a parameter to the dynamically open VI

    I want to open a vi dynamically, at the same time I have to pass a parameter to the dynamically open VI. Is it possible to do?

    Thank you

    Chrystelle Roy

    Passionate about LabVIEW

    Check here https://zone.ni.com/reference/en-XX/help/371361M-01/lvconcepts/dynamic_loadcall_vis/

  • Pass the parameter to the functions called from a dll

    Hi all

    I am interfacing a motor controller for PMC - 100 through the Protocol of Performax using labwindows.

    I need to explicitly link the PerformaxCom.dll and call functions with him. I'm calling this function

    BOOL fnPerformaxComOpen (DWORD IN dwDeviceNum, OUT HANDLE * pHandle);

    Faithful:

    If you want to link explicitly, you can consult this article: http://zone.ni.com/devzone/cda/tut/p/id/8503

    It has a code snippet that shows passing two parameters to a DLL function.

    But as for your statement that "I don't know how to pass parameter to him", in the example, you reference, you pass a parameter: it's just a constant string rather than a variable.

  • Custom event is not captured by the Task Scheduler and unable to trigger by e-mail for the event

    Hello world

    We have installed the 9.0 table in our windows 2008 R2 server and Scheduler tasks to send if you find error occurred for the application in it. That's why we created SMTP inside. First, we have implemented the Task Scheduler and generate an error in the application of the table and run the task manually and we receive by e-mail. But when we go for automation by the custom event. The steps below that I follow:

    1. click the Start button, and then select administrative tools > Task Scheduler.

    2. click on the task of creating in the Actions pane on the right.

    3. in the dialog box create a task in the name text box, type a name for the task and provide a description if you want.

    4. in the section security options, select run whether user is logged in or not.

    5. click on the triggers tab, and then click the new button.

    6 to start the task drop-down list, select an event.

    7. in the settings section, select custom and click the new event filter.

    8. for the event level, select the error box.

    9. selection of the Source, in the event source drop-down list, select the table server checkbox.

    10. click OK to close the new dialog box even filter and then click OK again to close the new trigger dialog box. The event trigger is now configured.

    11. in the dialog box create a new task, click the Actions tab and click the new button.

    12. in the Action new dialog box, in the drop Action, select send e-mail.

    13. under the settings section, fill in the form as required, including the SMTP server.

    Note: It is necessary to enter the valid e-mail addresses in the From and to text boxes.

    14. click OK to close the new dialog Action.

    15. click OK to close the dialog box create a task and finish configuring e-mail alert.

    If please see this and feel free to contact me if you have any information.

    Concerning

    Valerie

    Mob: 469 345 3625

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • Resolver of custom events and custom notification event

    Hello

    I have to build a custom resolver of Notification event that is used to generate a custom event.

    I've not done this before. Could you please let me know how can I do this IOM.

    Thank you

    When you perform the import, put your xml on

    /someFolder/custom/yourfile.XML and point import.sh to /somefolder to

    preserve the custom as a part of the full path

  • How to pass the parameter to the script for interface/Package in ODI

    Hello

    Yesterday I asked a question how to pass a parameter to run the script interface or the procedure?

    I don't know if it's possible.

    Any clarification will help you.

    Kind regards

    Mahesh

    Mahesh, why not try this in your machine? This will give you more clarity and confidence.

    ODI has always check if there is any variable used inside an object regardless of the interface or procedure or package. So whenever you generate the script, you will be asked to select the boot parameters. She's. Whenever you use this scenario, make sure you that you add the variables in the additional variables section of the Properties tab.

    So answer is that it is possible.

    Bravo!

  • Pass a parameter to a function to use AS the operator in

    I'm trying to pass a parameter to a function that uses the LIKE '% name_in % ',.
    I don't know how to use...

    the setting is called "name_in".


    Thanks in advance,
    M

    Hello

    Mehrdad says:
    I'm trying to pass a parameter to a function that uses the LIKE '% name_in % ',.
    I don't know how to use...

    the setting is called "name_in".

    Your code should say:

    ... LIKE '%' || name_in || '%'
    

    If name_in is inside the single quotes, it will mean the 7 characters literals 'n', 'a', ', 'e', '_', 'i' and 'n'.
    You want to refer to the variable named name_id, in order to keep the name of the variable outside of the quotation marks.

  • Where in the Site Catalyst custom events will appear?

    I was wondering. Where in the Site Catalyst custom events will appear? I have the following code:

    scope.customAnalyicsTracker ('customEvent1', 'Subscribe_Clicked');

    customAnalyicsTracker: {function (realName, variable)}

    adobeDPS.analyticsService.trackCustomEvent (realName, variable);

    }

    The code above does not make mistake, but I don't see Site Catalyst. I'm looking under custom HTML > custom events > Custom events 1 and I do not see it.

    Please let me know if I'm doing something wrong in the code above, or am I looking in the wrong place to Site Catalyst.

    Thank you!

    You are looking in the right place in SiteCatalyst. Ping me directly ([email protected]) with your ID on the report, and we can take it from there.

    Thank you

    Shikha

Maybe you are looking for

  • How to get out of the Windows safe mode?

    When I try to install programs such as I Tunes, I get an error message saying that the installation could not be preformed because my computer in safe mode. How to make it out of SafeMode so I can install programs?

  • My wireless internet does not work to its maximum.

    Hey, I recently bought a new laptop with Windows 7, and the wireless internet connection seems to work perfectly. But then I found that not quite like the itunes store, Skype and aim. It works only if I wiring. He never seems to be something wrong wi

  • Download the ADF works for a time the frist

    I have a ADF table to JSF page which is bounded to the View Object which contains the files downloaded to the user. This View Object contains all the information needed to download a file like blob domain , file type and file name . For each line, th

  • Download Premiere Pro without creative cloud

    HelloPremiere Pro download takes hours and I can´t keep the computer where it will be installed in market or dedicated to download for so long. I need to download the Setup program on a Linux computer and bring it back then on install on Windows.Wher

  • Yosamite leg down

    Hi all! I'm under CC 2014 on Mac os Yosemite. I noticed a problem with moving along photography. When I use my trackpad (on Macbook pro) diagonal movements are lugging. I also tried with wacom tablet and everything was good. In other applications for