Custom Event with multiple EventTypes

Hello All, First thanks for all those who tryied to help me and apologize for my approximative english.
I would like to create the more properly as possible a Custom Event with multiple EventTypes, like the MouseEvent typicaly. 
With Some EventType which permit to acces to some attributes and other not. But I'm totaly lost,  The second solution if someone knows how, is to explain to me how to do to acces to the code of the MouseEvent.as 
Thanks! 
Ps: you will find below the basis of the code i have begin. 
package fr.flashProject
    import flash.events.Event;
     * @author
    public class SWFAddressManagerEvent extends Event
        public static const CHANGE_PAGE:String = "change_page";
        public static const ERROR_404:String = "error_404";
        public static const HOME_PAGE:String = "home_page";
        private var _page:String;
        private var _params:Object;
        public function SWFAddressManagerEvent(type:String, pPage:String = null, pParams:Object = null, bubbles:Boolean=false, cancelable:Boolean=false)
            super(type, bubbles, cancelable);
            _page = pPage;
            _params = _params;
        public override function clone():Event
            return new SWFAddressManagerEvent(_type, _page, _params, bubbles, cancelable);
        public override function toString():String
            return formatToString("SWFAddressManagerEvent", "type", "page", "params", "bubbles", "cancelable", "eventPhase");
        public function get page():String { return _page; }
        public function get params():Object { return _params; }       

I am not sure what you are trying to accomplish but event can have only single type. Event type is just a string that is typically a constant - exactly like your constants.
When dispatched, each event INSTANCE has only one type. Again, these types are described in a type parameter by a string. Each dispatched MouseEvent DOES NOT have multiple types but ONLY ONE. It does have multiple constants that are used to assign type at runtime as does your event.
If you are talking about multiple parameters, you already do that in your custom event class. You have _page and _params. Nothing stops you from adding more parameters.
Also I am not sure why you need getters for _page and _params.

Similar Messages

  • How to queue custom events with out using af:calientListener.- onKeyUp.

    Hi,
    I have a custom component ( extending richinput text).
    defined a new attribute called "onkeyup" and added necessary logic in Renderer. Some thing like
    write.writeAttribute("onkeyup" , "handleEvent()");
    I rendered the java script code too ..... in my custom renderer. ( I neigther want to write java script in metaContainer of document tag nor wants to use resource tag..)
    and the handleEvent code is something like this.
    function handleEvent()
    In this method i want to write the code which pushes my custom event to the queue.
    some thing like this..
    component = event.getSource();
    AdfCustomEvent.queue(component, "customEvent",{payload:component.getSubmittedValue()}, true);
    event.cancel();
    Usually if use a clientListener then it will call the method {  handleEvent(event)  } passing event parameter so that we can get the source of that event.
    But as i dont want to use the clientEventListener.... as of now... i can't get the component because i don have the event object with my method.
    So could any one please letme know , how can i queue my custom event in to my customcomponent... with out using ClientListeners.
    Edited by: mchepuri on Nov 9, 2009 10:04 AM

    Hi,
    AFAIK, you cannot queue an event to the serverListener without a clientListener.
    -Arun

  • Post a custom event with jsp portlet

    I have a portal page which contains a jsp portlet and a couple of other portlets.
    The jsp has several links and when the links are clicked and the page is redrawn on the portal, I want the jsp portlet to fire events to which the other portlets in the page can react to.
    To achieve this, I have attached a backing file to a jsp portlet and have a custom event being fired (from the handlePostBack method) when certain conditions are met. The problem is that the handlePostBack method is not called in the jsp portlet lifecycle (only init(), preRender() and destroy() are called). I realize it may be because the urls dont have the _nfpb parameter set. I did try adding that to the link url - but no luck.
    Will someone point me as to what is wrong with the setup described above.
    ram.

    Kevin,
    How would I use postbackURL tag on a url which already has the "?" appended - for example if my url is "/somedomain/something.portal?cmd=4", the postbackUrl tag converts it as "/somedomain/something.portal?cmd=4?_nfpb=true&_page_Label=..."
    Shouldnt it have the intelligence to sense that the url already contains "?" and hence it should use '&' to append further parameters.
    Also if I strip out my "?cmd=4" from the url and just provide the bare url so that it is now free to add the "?_nfpb=true" to the url, how do I instruct the tag to later append my cmd=4 parameter to the query string? I see an attribute called "parameters" but how do I provide a name value pair? Or should I simply provide the string "cmd=4" as attribute value?
    As of now I am contructing the url object and the jsp looks a bit unwieldy though it works :)
    Thanks,
    Ram.

  • Customer Exit With Multiple Ranges

    Hi Experts,
    I have created a customer exit for my query. The values from this customer exit are multiple intervals.
    I|BT|2005001|2005006
    I|BT|2005002|2005007
    I|BT|2005003|2005008
    Is it possible to pass these interval values to a selection-options variable in my query? What type of variable should I use? Thanks in advance.
    Juice

    Hi San,
    Thanks for the reply. I tried setting the variable as interval but when I run the query in RSRT, i recieve an error message and then it won't display anything.
    However, when I set the variable to selection-options, the intervals seem to overlap. Instead of displaying like (as in RSRT ABAP Debugging mode):
    I|BT|2005001|2005006 -> Jan 2005 to June 2005
    I|BT|2005002|2005007 -> Feb 2005 to July 2005
    I|BT|2005003|2005008 -> March 2005 to August 2005
    It displays Jan 2005 to August 2005 in the query.How can I correct this?  Please help. Thanks.
    Juice

  • Writing a custom component with multiple fields.

    Does anyone have some pointers on writing a custom component that properly handles multiple input fields?
    An example usage might be as follows:
    Assume the following java classes:
    public interface Address {
        //... getters/setters for Address.
    public class Company{
        Address getAddress(){...};
    }The tag usage might be something like the following:
    <custom:address value="#{myCompanyBean.address}" />
    Extending UIComponentBase I can easily render the output and create all the needed input elements. I'm also able to properly retrieve the submitted values in the decode method. But I'm unsure how to handle the "UpdateModelValues" step. Do I simply over-ride processUpdates, or is there more housekeeping to be done?
    Thanks.

    I'm guessing that doing addChild inside createChildren causes an infinite loop.
    Why aren't you just doing this with MXML?  it would be a lot simpler.

  • Custom Dimension with multiple children defined as "Never Share"

    Hyperion Planning - 11.1.1.3
    There is Custom dimension "Appliance" with root defined as a "Never Share". It has multiple level 0 (SubAppl1, SubAppl2, SubAppl3 etc) members with "Store". Data is some times loaded at root level and some times at the lower levels and at times both. What is the expected result?
    When POV is Appliance and when it is drilled down?
    For Ex:
    For Jan -
    Appliance is 100, No other members loaded with data.
    For Feb -
    Appliance is 30
    SubAppl1 is 10
    SubAppl2 is 10
    SubAppl3 is 5
    POV
    Appliance Jan - 100
    Appliance Feb - 30 or 25? and why?
    Trying to understand the behavior or "Never share" in this scenario.
    Appreciate your feedback.
    Edited by: 847514 on Mar 28, 2011 11:17 AM

    Never Share has no bearing on your sample. The Never Share flag is to prevent a implicit sharing which will happen when you have one parent with a single child under it. Your structure is not setup such that an implicit share would occur based on your example.
    I really do not recommend loading data at upper level members as this means you can never run a normal aggregation on your data. If you were to aggregate your data and you happened to have the AGGMISSG set to true you would see the data in your january example of 100 was removed due to the level 0 members not having any values.
    So the question of your February being 30 or 25 is did you load 30 to February Appliance or did you load to the level 0 and then aggregate?
    Regards,
    John A. Booth
    http://www.metavero.com

  • Custom Infotype with multiple long text fields

    Hi,
    We have a need to create a custom Infotype (in PA or PD) that will contain more than one long-text area.
    I've searched this forum and found that there are generally two approaches :
    1. use the HR clusters for long-text and setting the ITXEX field in PA
    2. using SAP standard text area (SO10) and functions such as READ_TEXT, SAVE_TEXT, etc.
    The problem with (1) is that it can only store one long-text.  We need to have many.  Please correct me if we can hold more than one long text in the cluster...?
    With regard to (2), I'm just not sure that this is the correct place to store the long text...?
    If I was to adopt option (2), could I just use the key of PA9nnn (ie: PAKEY) as the key/TDNAME for STXH?
    Are there any other methods to store long text?
    As well, is it possible to create a custom Infotype in PD?  Can we use PM01 to create PD infotypes?
    Thanks,
    Raj

    Raj
    Sorry I'm not much help on the two questions you have raised...you have probably already got answers by now anyway..however FYI check out link below for enhancing PD infotypes (use transaction PPCI).
    enhance infotypes

  • Building Contextual Events with multiple parameters

    I am working in JDeveloper 11.1.1.4 and trying to build a contextual event, but ran into a issue that I find unclear. When building the Subscribers on my page definition, in the Property Inspector, how do I define multiple parameters in the customPayLoad element? In all the examples I've found, they reference putting ${payLoad} as the value and they only show one parameter. I need each value to be unique for each parameter. How do I accomplish this?

    for this you can use attributes
    say suppose if you are using table then you can pass values from producer like
                Map attributes = table.getAttributes();
                attributes.put("param1", param1);
                attributes.put("param2", param2);
                attributes.put("param3", param3);
                attributes.put("param4", param4);and consume it like
        public void handleBusinessChkListEvent(Object payload) {
            SelectionEvent selectionEvent = (SelectionEvent)payload;
            UIComponent component = (UIComponent)selectionEvent.getSource();
            String param1=
                (String)component.getAttributes().get("param1");
            String param2= (String)component.getAttributes().get("param2");
            Boolean param3=
                (Boolean)component.getAttributes().get("param3");
            String param4=
                (String)component.getAttributes().get("param4");
    }

  • Customer Report with multiple conditions?

    Hello <<text removed>>
    I have a project that I am curious if it is possible using BW and BEx Analyzer.
    I have a Cube that contains Customer, Brand, Revenue etc....
    Lets say i have the following values
    Customer: 1,2,3,4,5,6
    Brand:      1,2,3
    I need a report, series of reports, or a workbook that can provide the following.
    a. List and count of customers that purchased $500+ of only Brand 1
    b. LIst and count of customers that purchased $500+ of only Brand 2
    c. List and count of customers that purchased $500+ of only Brand 3
    d. List and count of customers that purchased $500+ of Brand 1 and $500+ of Brand 2
    e. List and count of customers that purchased $500+ of Brand 1 and $500+ of Brand 3
    f. List and count of customers that purchased $500+ of Brand 1, $500+ of Brand 2 and $500+ of Brand 3.
    I think you get the point
    This report should look at the previous 12 months of data.  And the Customer should not appear on the report more then once because that is how the criteria presented above should work.
    I was able to get this to work for a,b,c by restricting a query to the brand and using a condition of $500+ for revenue
    I was also able to get this to work for d and e by using the resolution for the single brand as a value set as input for the dealers in a similiar query restricted to a different brand.
    Anyway I hope i can find some ideas/approaches that would meet this requirement!
    Thank you,
    Nick
    Edited by: Matt on Jan 13, 2011 9:06 AM

    Hi Nick,
    See if this works.......
    Put customer in Rows.
    Create 3 restricted key figures for Revenue one with each brand. gets difficult if you want to do this for many brands...
    Create a calculated key fig and use the expression revenue_rkf1 > 500. this expression in the calc key fig returns 1 if revenue is > 500, othewise returns 0. Similarly create 2 more CKFs with expressions using the other RKFs for revenue.
    Now report may look like this:
    Customer      brand1         brand2          brand3
    Cust1...........            0..........                   1............                    1
    Cust2...........            1..........                   1...........                     0
    Now add logic to get customers who bought brand 1 > 500 and brand2 > 500 and other combinations. For that create different formulas like brand1brand2, brand 2brand3, brand1brand3, brand1brand2+brand3.
    Now report may look like this:
    Customer      brand1         brand2          brand3     for1        for2       for3       for4
    Cust1..........0............1..........1........1......2....1.....2
    Cust2..........1............1..........0........2......1....1.....2
    cust3..........1............1..........1........2.......2....2.....3
    Now create 4 calc key figures. In CKF1 use expression for1 > 1. This checks if value in formula1 is greater than 1, if yes puts 1 otherwise 0. Use the same expression for CKF2 and CKF3 using for2 and for3. Create CKF4 with expression for4 > 2.
    Now the report looks like this:
    Customer      brand1         brand2          brand3     for1        for2       for3       for4    CKF1      CKF2     CKF3       CKF4
    Cust1...........0...........1...........1.......1......2.....1.....2......0........1.......0........0
    Cust2...........1...........1...........0.......2......1.....1.....2......1........0.......0........0
    cust3...........1...........1...........1.......2......2.....2.....3......1.........1.......1........1
    Count of CKF1 gives the number of customers who bought brand1 for 500+ usd and brand2 for 500+ usd.
    Count of CKF4 gives the number of customers who bought all brands for more than 500 $ each.
    The repot gives the data needed but may not look good with number display against customers.
    Regards,
    Murali.
    Edited by: Murali Krishna K on Jan 7, 2011 10:52 AM
    Edited by: Murali Krishna K on Jan 7, 2011 11:10 AM

  • How do I try to create a custom poster with multiple photos?

    Each time I try to do a Photo Project and make a custom poster, the software stops working?  Has anyone else had this problem?  Thanks

    hi Motz
    it is alot of work., are u comfortible with pse Elements editor?
    david :>

  • Custom LayoutSet with multiple Menus

    Hello All -
    I am trying to implement a custom layout set that will contain the basic tree\list layout but have 3 menu's
    1.  Standard Menu Bar Control
    2.  A Button Menu
    3.  A Link Menu
    I have been playing with my layout set and see  you can get the menu bar from your layout set configuration using the lines..
    ControlFactory cf = ControlFactory.getInstance();
    Control c = null;
    com.sapportals.wcm.repository.IResourceContext context = getProxy().getResourceContext();
    c = cf.getControl("MenuBarControl", context)
    I am unsure where the String MenuBarControl comes from however and what it would be to get the Link or Button Control...
    Thanks in advance for your help on this one.

    Hi Brandon
    To render the extra two Menu bars you need not define additional Collection renders , because the layout set can identify Menu Bars separately from Collection renders. To have more more Menu Bars you will have to modify the layout set code to something like this ...
      private void createControls() {
         this.controls = new Control[5];
         ControlFactory cf = ControlFactory.getInstance();
         Control c = null;
         IResourceContext context = this.getProxy().getResourceContext();
         c = cf.getControl(cf.MENU_BAR_CONTROL, context);
         this.controls[0] = c;
         if (c instanceof IMenu) {
           ((IMenu) c).setProxy(this.getProxy());
           ((IMenu) c).setPushStack(true);
           ((IMenu) c).setGroup(IParameterName.UI_GROUP_MASS_KEY);
         c = cf.getControl(cf.MENU_BAR_CONTROL, context);
         this.controls[1] = c;
         if (c instanceof IMenu) {
           ((IMenu) c).setProxy(this.getProxy());
           ((IMenu) c).setPushStack(true);
           ((IMenu) c).setGroup(IParameterName.UI_GROUP_MASS_KEY);
    //repeat again for third menu bar
    However I have not tried getting a button into a menu bar. Links are possible as you are aware
    Regards
    Pran

  • Help! - Mouse Event with multiple JTables....

    Hi
    My GUI has a different table on various JPanels. What is the best way of telling the mouseClicked method which table is being clicked on.
    Right now, my code is:
    public void mouseClicked(MouseEvent me)
    Point p = me.getPoint();
    int selectedRow = table.rowAtPoint(p);
    int selectedColumn = table.columnAtPoint(p);
    Object o = table.getValueAt(selectedRow,selectedColumn);
    but this means that the method sees only the last table to be created.
    How do I tell it what table it's looking at?
    Thanks for any help you can provide.

    Hi Jim,
    yes for some reason ALV expects you to be using different tables. It seems that it does not save the contents of the tables at each call of 'append' rather it waits until 'display' to deal with the table contents at that time, which in your case is the 20 items.
    What you can do is use dynamic tables. check this out:
    REPORT  ZNRW_ALV_BLOCK                          .
    type-pools: slis.
    data : NUM1 type I,
    NUM type I.
    types:
    begin of str,
    client like mara-mandt,
    mat like mara-matnr,
    end of str.
    data
    tab type standard table of str.
    data :wa2 type slis_alv_event ,
    tab2 like standard table of wa2,
    wa1 type slis_layout_alv,
    wa type line of slis_t_fieldcat_alv,
    tab1 like standard table of wa.
    wa-reptext_ddic = 'Client Num'.
    wa-fieldname = 'CLIENT'.
    wa-tabname = 'TAB'.
    wa-ref_fieldname = 'MANDT'.
    wa-ref_tabname = 'MARA'.
    wa-seltext_l = 'CLIENT'.
    append wa to tab1.
    wa-reptext_ddic = 'Mat Number'.
    wa-fieldname = 'MAT'.
    wa-tabname = 'TAB'.
    wa-ref_fieldname = 'MATNR'.
    wa-ref_tabname = 'MARA'.
    wa-seltext_l = 'MATERIAL'.
    append wa to tab1.
    wa1-no_colhead = 'X'.
    wa2-NAME = SLIS_EV_TOP_OF_PAGE.
    wa2-FORM = 'WRITE_TOP_PAGE'.
    APPEND wa2 TO tab2.
    NUM = 0.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
    I_CALLBACK_PROGRAM = sy-cprog.
    DATA tabDREF TYPE REF TO DATA.
    FIELD-SYMBOLS <tab> TYPE table.
    do 2 times.
    CREATE DATA tabdref TYPE table of str.
    ASSIGN tabDREF->* TO <tab>.
    NUM1 = NUM1 + 10.
    refresh: tab.
    select mandt matnr up to NUM1 rows from mara into table <tab>.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    IS_LAYOUT = wa1
    IT_FIELDCAT = tab1
    I_TABNAME = 'TAB'
    IT_EVENTS = tab2
    TABLES
    T_OUTTAB = <tab>.
    enddo.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    FORM WRITE_TOP_PAGE.
    NUM = NUM + 1.
    WRITE: / ,
    / 'TABLE NUMBER :', NUM.
    ENDFORM.

  • Custom Events are repeating with the standard events

    Hello All,
    I am facing a problem with the customization of standard OA Page.
    We have modified the page by adding a new custom region with three buttons in it. We have also developed a controller for that region to handle the events. when a button is clicked, a new page opens up in a new window.
    I have observed that the custom controller is called when any event occurs in the page irrespective of the region.
    Now the actual problem is whenever any of the custom buttons are clicked, according to the requirement the new window opens up. But if we perform any other standard events in the page like clicking a standard LOV immediately after performing the custom event, then that most recent custom event is repeating with that standard event.
    how to prevent this repetetion of custom event with standard event?
    please help me solve this problem..
    Thanks in advance.

    For your page, are you setting the controller class for your various regions in the property inspector?

  • Create Component that Listens for Custom Event

    I've read a lot of tutorials and posts in this forum but still seem to be missing something.
    I want to be able to create an arbitrary number of instances of a custom class (based on Button) that each listen to a custom event dispatched in the application.  Eventually the event will carry data (including information that will let each Button determine whether it should react to the event), but for now I just want them to be able to hear the event.
    What's supposed to happen is
    1) Clicking the button labeled "I Make the Button" creates an instance of EventHearingButton using this.addElement.
    2) Clicking the button labeled "I Send the Event" dispatches the SuperCustomEvent custom event, with the additional information "I heard that" stored in the Information string
    3) The created EventHearingButton hears the event and updates its label to the value in the Information string.
    What actually happens is the EventHearingButton is created OK, but nothing happens when the "I Send the Event" button is clicked.
    Main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/halo">
         <fx:Metadata>
              [Event(name="SuperCustomEvent", type="Classes.SuperCustomEvent")]
         </fx:Metadata>
         <fx:Script>
              <![CDATA[
                   import Classes.EventHearingButton;
                   import Classes.SuperCustomEvent;
                   protected function EventDispatcherButton_clickHandler(event:MouseEvent):void
                        var NewEvent:SuperCustomEvent = new SuperCustomEvent("I heard that");
                        this.dispatchEvent(NewEvent);
                   protected function button1_clickHandler(event:MouseEvent):void
                        var NewButton:EventHearingButton = new EventHearingButton();
                        NewButton.x=270;
                        NewButton.y=130;
                        this.addElement(NewButton);
              ]]>
         </fx:Script>
         <s:Button x="270" y="90" label="I Send The Event" id="EventDispatcherButton" click="EventDispatcherButton_clickHandler(event)"/>
         <s:Button x="270" y="50" label="I Make the Button" click="button1_clickHandler(event)"/>
    </s:Application>
    Classes.EventHearingButton.as
    package Classes
         import spark.components.Button;
         import flash.events.Event;
         import Classes.SuperCustomEvent;
         public class EventHearingButton extends Button
              public function EventHearingButton()
                   super();
                   this.label="I haven't heard yet";
                   this.addEventListener(SuperCustomEvent.SUPERCUSTOMEVENT,SuperCustomEventHandler);
              private function SuperCustomEventHandler(event:SuperCustomEvent):void {
                   this.label=event.EventInformation;
    Classes.SuperCustomEvent.as
    package Classes
         import flash.events.Event;
         public class SuperCustomEvent extends Event
              public var EventInformation:String;
              public static const SUPERCUSTOMEVENT:String = "SuperCustomEvent";
              public function SuperCustomEvent(Information:String)
                   super(SuperCustomEvent.SUPERCUSTOMEVENT, true);
                   this.EventInformation=Information;
              override public function clone():Event{
                   return new SuperCustomEvent(EventInformation);

    "nikos101" <[email protected]> wrote in
    message
    news:ga59t5$8nh$[email protected]..
    >I tried something like what AMy described in a custom
    component
    >
    > dispatchEvent(new Event("Cancelled_Form"));
    >
    > I then added the following Listener in my application
    file;
    >
    > this.addEventListener("Cancelled_Form",cancelledForm);
    >
    > but it is never heard. Does anyone know what I have done
    wrong?
    Try attaching the event listener to your component rather
    than the
    application.
    HTH;
    Amy

  • How to dispatch custom events from an item renderer used for Datagrid Column

    Hi,
    I am using an Item Renderer for a Data Grid Column and in that mxml, I am dispatching a custom event with data.
    But the main mxml which has the DataGrid is not able to resolve the event. How can I solve this?
    Thanks

    Hi,
    This is the constructor for Event.
    public function Event(type:String, bubbles:Boolean  = false, cancelable:Boolean  = false)
    When you created your custom event after extending from Event, for the parent container receives the event, the bubbles property must be set to true.
    Please check if you have done so. That should solve the problem. Let me know if it doesn't.
    Nishad

Maybe you are looking for