PJC and Custom Event

I'm trying to create a Forms PJC which extends VTextField. The PJC should have the added feature to be able to set a limit on the time allowed to receive all input characters. This is to force the user to use other input devices than keyboard, such as card reader. By looking at the Forms demos I was able to make my PJC work, but it can't raise a custom event to notify Forms of the timeout. Only if I extend the generic class VBean can I raise a custom event (dispatchCustomEvent). I have tried to use the VBean as a wrapper for a VTextField but it does not look and act like a textfield anymore. The timeout and custom event works, but I can't get the input value from Forms. I have tried instantiating a VBean inside a VTextField to raise the custom event but it never reaches the Form. So what to do?
But when I extend VBean instead of VTextField I have problems getting something which looks and acts like a textfield.

Hello,
+1. Complete Forms Solution described in the Dynamic poplist in a multi-record item. thread.+
This solution is based on dynamic list population with appropriate predefined record group (the number of such predefined record groups could be rather big --> 1 Continents*Countries.+
Record Groups can be totally dynamic, so you don't need to have them pre-existing at runtime.
Francois

Similar Messages

  • Item Details iView and Custom Event

    Dear experts,
    I need to implement a custom validation using a BAPI call to external R/3 system.
    I am planning to use the Item Details custom event as a trigger for my custom web dynpro and have my BAPI call there. My question is, can I do that? The reason I'm asking is because the event says it's a post-save-event. What I need to do is to prevent the actual Saving and display an error message if the
    BAPI call returns "false".
    Thanks for your help,
    Boris

    I see that there are too many answers to this thread
    OK, here is how we solved the issue. We are subscribing in a custom Web Dynpro to the Post-save-event of the Item Details iView and we are performing the BAPI call.
    Based on the result of the call we are setting a flag on the record and this flag is used as a syndication block.
    Hope that helps someone ...
    Boris

  • Custom component and custom event problem

    hello , i have a strange problem since one week , is that i can't handle the events becoming from my custom component , here is my code :
    Event Class :
    package events
         import flash.events.Event;
         public class Ev extends Event
              public static const UPDATE:String="update";
              public var data:String;
              public function Ev(type:String,data:String)
                   super(type);
                   this.data=data;
              override public function clone():Event
                   return new Ev(type,data);
    MXML component :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
         <fx:Metadata>
              [Event(name="onMenuChange",type="events.Ev")]
         </fx:Metadata>
         <fx:Script>
              <![CDATA[
                   import events.Ev;
                   import mx.events.IndexChangedEvent;
                   protected function accordion1_changeHandler(event:IndexChangedEvent):void
                        dispatchEvent(new Ev(Ev.UPDATE,event.newIndex.toString()));
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Placer ici les éléments non visuels (services et objets de valeur, par exemple). -->
         </fx:Declarations>
         <mx:Accordion width="200" height="200" change="accordion1_changeHandler(event)">
              <s:NavigatorContent label="Menu 1" width="100%" height="100%">
              </s:NavigatorContent>
              <s:NavigatorContent label="Menu 2" width="100%" height="100%">
              </s:NavigatorContent>
              <s:NavigatorContent label="Menu 3" width="100%" height="100%">
              </s:NavigatorContent>
         </mx:Accordion>
    </mx:VBox>
    the main container :
    <?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/mx" minWidth="955" minHeight="600" xmlns:local="*">
         <fx:Script>
              <![CDATA[
                   import events.Ev;
                   import mx.controls.Alert;
                   protected function comp1_onMenuChangeHandler(event:Ev):void
                        Alert.show(event.data,"notice");
              ]]>
         </fx:Script>
         <local:Comp onMenuChange="comp1_onMenuChangeHandler(event)"/>
    </s:Application>
    any help will be welcome !

    hi,
    Not sure why your custom event is not working, I tend not to worry about 'custom' events unless I need to transfer a lot of information.
    Here is a way to 'simplify' event management.
    I just declare a new event in the meta data and then send it to notify that a change has been made. Although the parent can find the index value easily enough I also use two-way bind the navigators index so that it is directly available for the application to manipulate/read .
    http://gumbo.flashhub.net/events/  source included
    David.

  • Custom Listeners and custom events...

    I would like to know if there is a framework to perform the following.
    Let's says that I define a non-basic graphical object like three checkboxes inside a JPanel. It might be interesting to define a high-level event that would be all the three chechboxes are pressed, and it would be even nicer for listeners to be able to register to get this event.
    While I see how to implement listeners for existing events, I'm wondering if there is a framework available to "register" new events, so that you can add listeners to them without having to reimplement some kind of queue (and avoiding the threading problems).
    Thanks! a lot!

    I don't know any general framework.
    I did it this way:
    define:
    XXXListener-interface
    XXXEvent-class
    addXXXListener(XXXListener l)-method
    removeXXXListener(XXXListener l)-method
    fireXXXfoo(XXXEvent e)-method
    Maintain a Set of all listeners (perhaps needs to be sychronized; see Collections class for this).
    In the fire-method just loop through the set and call the proper method of the Listener interface.
    Now you can anywhere in your class call this fire-method (first you have to create the proper event, of course). Then all listeners get notified.
    Greets
    Puce

  • Passing Object when custom Event is fired

    Hi,
    I need to pass an object from one page flow to other.
    I have referred to e-docs of bea. In a custom event, you can pass form beans.
    The object I need to pass is an hashmap. I can very well set it ina form bean and pass it, but that does not sound good creating a formbean just for passing object.
    Is there any better method to pass objects from Controller to other?
    Note:
    I am not invoking controller by giving its relative path in forward.
    I am using event handlers and custom events.
    Please reply,
    Suman

    I'm using Netweaver Developer Studio 7.1 SP03 PAT0005.
    Do someone knows if this version produces code that has some bugs related to custom event firing?
    This bug that I'm experiencing seems non deterministic and is driving me crazy.
    Thank you,
    Pietro
    Edited by: pietro.m on Oct 28, 2010 4:40 PM

  • Custome Event for the Result Set iView

    Hi,
    does anybody know how to set up the Custom Event on the Result Set iView in order to trigger an event when a record is selected?
    I know how to do it using an event Type = EPCF + Event Name + Namespace, but this creates an extra colum on the Result Set iView with the Custom Event name on it, that has to be click in order to trigger the event. I do not want click on this column, i just want to create the event when the record is selected.
    Regards
    Diego.

    Hi Diego,
    We are also implementing similar scenario.
    We also want to open a window on the clik of any column of the result and if the result is zero we want to trigger some another iView.
    So if u have found any solution can u just let me know.
    OR else can u  just elaborate on ur current scenario using EPCF and custom event.
    Thanks in Advance.
    Regards Shruti.

  • Custom Events and Scheduling more than once

    Hi,
    in BO 4.1, I successfully triggered WebI Report instance generation by a "Custom Event" through scheduling.
    Now, we have the requirement that the report should not be triggered only once but always when the event is triggered.
    At first glance, this looks tricky bc. in order that the report "reacts" to the event, the report itself must be scheduled with the event (it gets an instance "pending" that "wait + reacts" to the event). So it looks like we need schedule the report always manually with "event" before it is ready to react to the event specified in the scheduling.
    Is there any user-friendly trick to make the report react upon every fired event without having to "schedule" the report manually with the event?
    (Similar to schedule daily, just that the event is the trigger, note a daytime...)
    Best Regards

    Hi Florian,
    What is the frequency set under Recurrence option for the report instance?
    Can you give an idea like after how much time the event can be triggered?
    For example, if you are expecting the event to change in an hour, you can schedule the recurrence as hourly or you can specify something like 0 hours and 15 minutes or something like that.
    In that case, once the event is fired, your report instance will be ready to trigger after 15 minutes for the next run.
    Would suggest you to sync with the BO administrator as concurrent triggering of large number of instances can give load on Job Servers.
    Hope it will help in some way.
    Regards,
    Yuvraj

  • Custom Events and Listeners between classes

    I've got a project I've been working on for weeks that I'm
    having yet another problem with. I'm trying to learn AS3 which is
    why it's taking so long but that's not important for this post.
    I wanted to create a custom event class so that I could make
    sure the event does not interfere with other "COMPLETE" events that
    are being passed between classes. In other words, I have a few
    things that need to complete prior to a function being called...
    one is some XML being loaded and another is a font loaded. So, I
    thought I would create a custom FontLoaded class that extends Event
    and make the type something like "FontLoadedEvent.LOADED". That way
    I could listen for the XML "Event.COMPLETE" and this font event
    also.
    Please tell me if I'm going down the wrong path here but I
    don't seem to be getting the dispatched event for my new custom
    event. Also, how does one detect if it's being dispatched other
    than if the eventListener is fired? Any other ways to test
    this?

    You can trace the event to see if it dispatched.
    Also, this is not a good case to create a new event. Custom
    events are used to store additional information. MouseEvent exists
    because Event doesn't have localX, localY, etc. properties. Since
    you don't seem to be throwing additional properties, you can use a
    regular event.
    trace(dispatchEvent(new Event("panelFontsLoaded"));
    addEventListener("panelFontsLoaded", onFontsLoaded);
    Static consts are used to help debug typos. The event type is
    just a string, often stored in a const.

  • Custom Event generation and Handling

    HI all,
    I am new to java. I have a dataset which changes dynamically and this dataset is responsible for some other dataset(s). So whenever the original dataset is modified, the other datasets based on this dataset should be updated automatically so as to preserve the consistency.
    What I want to do is to write a custom event which is to be fired whenever the original dataset is modified and notify it to other datasets so as to ensure the consistency.
    Any help in this regard is extremely appreciated.

    HI Duffymo,
    Here is my problem for better understanding:
    I have a vector data in a NodePanel (this vector data originates from some other datastructure...but that is immaterial as we know that this data is an instance of that datastructure). This vectordata in NodePanel is responsible for another vectordata in SchedulePanel. The NodePanel and SchedulePanel are tabbedPanels in a tabbedframe. Whenever I update the vector data in NodePanel, the vector data in SchedulePanel needs to be updated.
    The solution you gave me, taught me an insight of the event handling in Java.
    I am quoting my source for your reference as I am unable to incorporate your idea into my project.
    Event class:
    import java.util.*;
    public class VectorUpdateEvent extends EventObject
         public VectorUpdateEvent(Object source)
              super(source);
    Interface to EventListener
    public interface VectorUpdateListener
         public void eventVectorUpdated(VectorUpdateEvent event);
    class EventGenerator
    import java.util.*;
    public class VectorUpdateEventIssuer
         implements EventListener
         public VectorUpdateEventIssuer()
              listListeners = new ArrayList();
         public synchronized void addVectorUpdateEventListener(VectorUpdateEvent l)
              listListeners.add(l);
         protected synchronized void removeVectorUpdateEventListener(VectorUpdateEvent l)
              listListeners.remove(listListeners.indexOf(l));
         protected void notifyVectorUpdateEvent(Object source)
              VectorUpdateEvent evt = new VectorUpdateEvent(source);
              Iterator itr = listListeners.iterator();
              while (itr.hasNext())
                   ((VectorUpdateListener)itr.next()).eventVectorUpdated(evt);
         private ArrayList listListeners;
    class where the event originates
    class NodePanel
         extends JPanel
         implements ActionListener, ListSelectionListener
         /////////////Constructors/////////////////////////
         public NodePanel()
              addNodeButton = new JButton("Add Node");
              delNodeButton = new JButton("Delete Node");
              dumpNodeButton = new JButton("Dump Node");
              reloadNodeButton = new JButton("Reload Node");
              browseButton = new JButton("Browse Node");
              exitButton = new JButton("Exit");
              add(addNodeButton);
              add(delNodeButton);
              add(dumpNodeButton);
              add(reloadNodeButton);
              add(browseButton);
              add(exitButton);
              setButtonsEnabled(false);
              addNodeButton.addActionListener(this);
              delNodeButton.addActionListener(this);
              dumpNodeButton.addActionListener(this);
              reloadNodeButton.addActionListener(this);
              browseButton.addActionListener(this);
              exitButton.addActionListener(this);
              nodesVector = new Vector();
              nodesList = new JList(nodesVector);
              this.vectorNodeAttributes = new Vector();
              JScrollPane scrollPane = new JScrollPane(nodesList);
              add(scrollPane,BorderLayout.CENTER);
              nodesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              nodesList.addListSelectionListener(this);
         ////////////////Methods///////////////////////////
         /////////////Event valueChanged///////////////////
         public void valueChanged(ListSelectionEvent evt)
              JList source = (JList) evt.getSource();
              setButtonsEnabled(true);
              desiredNode = (String) source.getSelectedValue();
              if (desiredNode == null)
                   setButtonsEnabled(false);
         //////////////Event actionPerformed////////////
         public void actionPerformed(ActionEvent evt)
              Object source = evt.getSource();
              if (source == addNodeButton)
                   addNodeButtonClicked();
              else if (source == delNodeButton && desiredNode != null)
                   deleteNodeButtonClicked();
              else if (source == dumpNodeButton && desiredNode != null)
                   JFileChooser d = new JFileChooser();
                   //d.setCurrentDirectory("");
                   d.setFileFilter(new XMLFilter());
                   int result = d.showSaveDialog(this);
              else if (source == reloadNodeButton && desiredNode != null)
                   JFileChooser d1 = new JFileChooser();
                   //d.setCurrentDirectory("");
                   d1.setFileFilter(new XMLFilter());
                   int result = d1.showOpenDialog(this);
                   //String filename=d1.getSelectedFile().getName();
              if (source == browseButton && desiredNode != null)
                   browseButtonClicked();
              else if (source == exitButton)
                   System.exit(0);
         //////////Enables or Diables the Buttons////////
         private void setButtonsEnabled(boolean enable)
              delNodeButton.setEnabled(enable);
              dumpNodeButton.setEnabled(enable);
              reloadNodeButton.setEnabled(enable);
              browseButton.setEnabled(enable);
              private void deleteNodeButtonClicked()
              if (noFieldDlg != null)
                   noFieldDlg.dispose();
              noFieldDlg = new NoFieldDialog("Delete the Node?");
              noFieldDlg.show();
              if (noFieldDlg.getDialogResult() == DialogResult.OK)
                   int nodeToRemove=0;
                   for (int i=0; i< vectorNodeAttributes.size(); i++)
                        if(((NodeAttributes)(vectorNodeAttributes.get(i))).getNodeName().compareTo(nodesList.getSelectedValue()) == 0)
                             nodeToRemove = i;
                   vectorNodeAttributes.remove(nodeToRemove);
                   nodesVector.removeElement(nodesList.getSelectedValue());
                   this.nodesList.setListData(nodesVector);
                   NodePanel.nodesPresent = nodesVector;
                   updateStaticNodeList();
    /*************** as soon as the NodePanel.nodesPresent is updated, the changes are to be reflected in the Schedule Panel ******************/
                   VectorUpdateEvent e = new VectorUpdateEvent(this);
                   VectorUpdateEventIssuer v = new VectorUpdateEventIssuer();
                   v.addVectorUpdateEventListener(e);
                   v.notifyVectorUpdateEvent(this);
         ///////////////Data Members////////////////////
         private JButton addNodeButton;
         private JButton delNodeButton;
         private JButton dumpNodeButton;
         private JButton reloadNodeButton;
         private JButton browseButton;
         private JButton exitButton;
         private String desiredNode;
         private OneFieldDialog oneFieldDlg = null;
         private NoFieldDialog noFieldDlg = null;
         private JList nodesList;
         private Vector nodesVector;
         private Vector vectorNodeAttributes;
         private static Vector nodesPresent = null;
    } // end class NodePanel
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    ////////////////Class SchedulePanel////////////////
    class SchedulePanel extends JPanel
    implements ActionListener, ListSelectionListener, VectorUpdateListener
         ////////////////Constructors//////////////////
         public SchedulePanel()
              addScheduleButton = new JButton("Add Schedule");
              delScheduleButton = new JButton("Delete Schedule");
              dumpScheduleButton = new JButton("Dump Schedule");
              reloadScheduleButton = new JButton("Reload Schedule");
              browseScheduleButton = new JButton("Browse Schedule");
              exitButton = new JButton("Exit");
              add(addScheduleButton);
              add(delScheduleButton);
              add(dumpScheduleButton);
              add(reloadScheduleButton);
              add(browseScheduleButton);
              add(exitButton);
              setButtonsEnabled(false);
              addScheduleButton.addActionListener(this);
              delScheduleButton.addActionListener(this);
              dumpScheduleButton.addActionListener(this);
              reloadScheduleButton.addActionListener(this);
              browseScheduleButton.addActionListener(this);
              exitButton.addActionListener(this);
              scheduleVector = new Vector();
              scheduleList = new JList(scheduleVector);
              this.vectorScheduleOperations = new Vector();
              JScrollPane scrollPane = new JScrollPane(scheduleList);
              add(scrollPane);
              scheduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              scheduleList.addListSelectionListener(this);
              //updateEventListener = new VectorUpdateEventIssuer();
              //updateEventListener.addVectorUpdateEventListener(this);
         /////////////Methods///////////////////////
         ////////////Event valueChanged/////////////
         public void valueChanged(ListSelectionEvent evt)
              JList source = (JList)evt.getSource();
              setButtonsEnabled(true);
              desiredSchedule = (String)source.getSelectedValue();
              if (desiredSchedule == null)
                   setButtonsEnabled(false);
         ////////////Event actionPerformed////////
         public void actionPerformed(ActionEvent evt)
              Object source = evt.getSource();
              if (source == addScheduleButton )
                   addScheduleButtonClicked();
              else if (source==delScheduleButton && desiredSchedule!=null)
                   deleteScheduleButtonClicked();
              else if (source == dumpScheduleButton && desiredSchedule!=null)
                   JFileChooser d = new JFileChooser();
                   d.setFileFilter(new XMLFilter());
                   int result = d.showSaveDialog(this);
              else if (source == reloadScheduleButton && desiredSchedule!=null)
                   JFileChooser d1 = new JFileChooser();
                   d1.setFileFilter(new XMLFilter());
                   int result = d1.showOpenDialog(this);
              else if (source == browseScheduleButton && desiredSchedule!=null)
                   browseScheduleButtonClicked();
              else if (source == exitButton)
                   System.exit(0);
         public void eventVectorUpdated(VectorUpdateEvent event)
              System.out.println("Hello! EventRaised");
         ///////////Data Members//////////////////
         private JButton addScheduleButton;
         private JButton delScheduleButton;
         private JButton dumpScheduleButton;
         private JButton reloadScheduleButton;
         private JButton browseScheduleButton;
         private JButton exitButton;
         private String desiredSchedule;
         private OneFieldDialog oneFieldDlg = null;
         private NoFieldDialog noFieldDlg = null;
         private JList scheduleList;
         private Vector scheduleVector;
         private Vector vectorScheduleOperations;
         private VectorUpdateEventIssuer updateEventListener;
    } // end class SchedulePanel
    I hope you understood my problem now. The NodeAttributes is a datastructure containing the node name and an associated table for that. THe ScheduleOperations is similar to the NodeAttributes but it contains a DefaultTableModel which inturn consists of a column which is filled with the list of current nodes available + their schedules.
    I am sorry for my long posting.
    Thanks once again in anticipation.

  • Custom Event and Custom Expression Deletion in PCW

    Hi Sap Gurus,
    How can i delete the custom event and custom expression created by me in process controlled workflow... I have observed the deletion button grayed out... Is there any other option to delete the custom event and expression.
    Thanks in advance

    Hello Sanjay,
    check below thread:
    BRF - Can not delete expression
    Regards.
    Laurent.

  • Why override custom event-and when to override it?

    Hi guys..
       I always have a question about override custom event. I am not sure why or what do to inside override function. I searched google but didn't get too many feedbacks.
    Also, my projects seem work fine even though I use my custom event without override. Anyone could explain it? I appreciate if someone can light me up.

    Yes, it's a good practice to override the clone function of the superclass but you're not really overriding your custom event. Guess I didn't say it well before. Just google something like "Flex override clone function" and you'll be taken to the livedocs, most likely, where you'll find this paragraph
    You are required to override the Event.clone() method in your subclass. The clone() method returns a cloned copy of the event object by setting the type property and any new properties in the clone. Typically, you define the clone() method to return an event instance created with the new
    operator.
    I've not really thought about it before but I assume that's in case you want to extend your class. Anyway, you can pretty blindly just include that override of the clone function and not get into trouble. It's just saying, hey, if something is dealing with this custom event, don't return a copy of the superclass - the Event class - return a copy of this custom event that I've created to extend the Event class to add special functionality.

  • How to define custom event and how to trigger the defined event

    hi,guys
    hurry issue....................hope get help.
    I am using oracle weblogic 10gr3 portal.and we choiced java portlet.as of now,we got some question about custom Event.hope you can give some idea....
    thank you so much.
    question detail:
    1.for java portlet ,how to define custom event.
    2.how to trigger this event.
    3 about the data,may be sometime need to transit Biz data.
    auctully,I just want to implements between two portlets communicate.
    for example:
    existing portletA,portletB.
    portletA is a list,like:
    A AA <button>
    after I click this buttom,then portletB will be effect,it means they are interact with each other.
    does anybody hit this issue before,if you solved pls share me .
    thank you for you help....

    Hello,
    Please note that everything below applies to JSR168 portlets ONLY- JSR286 portlets and other portlet types handle events a little differently.
    From inside your JSR168 portlet you can send an event during processAction or when receiving another event by using the PortletBackingContext object, such as:
    import javax.portlet.ActionResponse;
    import javax.portlet.ActionRequest;
    import javax.servlet.http.HttpServletRequest;
    import com.bea.netuix.servlets.controls.portlet.backing.PortletBackingContext;
    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
    HttpServletRequest httpRequest = (HttpServletRequest) actionRequest.getAttribute("javax.servlet.request");
    PortletBackingContext portletBackingContext = PortletBackingContext.getPortletBackingContext(httpRequest);
    portletBackingContext.fireCustomEvent("customEvent", "This is a custom event");
    To receive an event, in your .portlet file you just need to put in a "handleCustomEvent" tag specifying which method to call when the event is received, such as:
    <?xml version="1.0" encoding="UTF-8"?>
    <portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
    xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
    <netuix:javaPortlet title="Listening Portlet" definitionLabel="yourPortletName">
    <netuix:handleCustomEvent event="customEvent" eventLabel="customEvent" filterable="true" description="custom event handler">
    <netuix:invokeJavaPortletMethod method="processCustomEvent"/>
    </netuix:handleCustomEvent>
    </netuix:javaPortlet>
    </portal:root>
    Then, in your receiving portlet the method "processCustomEvent" would receive the event, such as:
    public void processCustomEvent(ActionRequest actionRequest, ActionResponse actionResponse, Event event)
    The event payload can be any Serializable object you want, but for forward-compatibility with JSR286 it would be ideal if it had a valid JAXB binding.
    Kevin

  • Query regarding creating a Custom Event and Firing.

    I have created a custom event,a custom listener and a custom button.
    But when I click on custom button,my event is not being fired.
    When and how do I need to invoke the fireEvent() ?
    Please can any body tell me if I have overlooked any thing ?
    Thanks,
    // 1 Custom Event
    import java.util.EventObject;
    public class MyActionEvent extends EventObject{
            public MyActionEvent(Object arg0) {
         super(arg0);
    // 2 Custom Listener
    import java.util.EventListener;
    public interface MyActionListener extends EventListener {
          public void myActionPerformed(MyActionEvent myEvent);
    // 3 Custom Button
    public class MyButton extends JButton {
        // Create the listener list
        protected javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList();
          public MyButton(String str){
         super(str);
         public void addMyActionEventListener(MyActionListener listener) {
             listenerList.add(MyActionListener.class, listener);
        protected void fireMyActionEvent() {
            MyActionEvent evt = new MyActionEvent(this);
            Object[] listeners = listenerList.getListenerList();
           for (int i = 0; i < listeners.length; i = i+2) {
                 if (listeners[i] == MyActionListener.class) {
                      ((MyActionListener) listeners[i+1]).myActionPerformed(evt);
    } // end of class MyButton.
    // 4 Test my Custom Event,Listener and Button
    public class MyButtonDemo extends JPanel {
        protected MyButton b1;
        public MyButtonDemo() {
            b1 = new MyButton("Disable Button");
            b1.setToolTipText("Click this button to disable the middle button.");
            b1.addMyActionEventListener(new MyActionListener() {
         @Override
         public void myActionPerformed(MyActionEvent myEvent) {
         System.out.println("My ActionEvent....");
            add(b1);
        private static void createAndShowGUI() {
            JFrame frame = new JFrame("ButtonDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            MyButtonDemo newContentPane = new MyButtonDemo();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Hi Stan,
    I would like to use my custom action listener rather that using the the normal actionPerformed(ActionEvent e)
    But some how this event is not being fired.
    Any suggestions to fire this?
    b1.addMyActionEventListener(new MyActionListener() {
             @Override
             public void myActionPerformed(MyActionEvent myEvent) {
         System.out.println("My ActionEvent triggered....");
    });

  • Custom Event and Custom itemRenderer

    I created an MXML component based on <mx:Button/> and
    am using it as a custom itemRenderer in a DataGrid.
    I also created a custom event, and my custom itemRenderer
    dispatches the event. I know the event gets dispatched because I
    see it in the debugger.
    I register an event listener in the parent of the DataGrid,
    but the event handler is not being called.
    If you have any advice, please help.

    In the DeleteItemEvent constructor:
    super(type, bubbles);
    TS

  • Event Linkage for custom Workflow and Custom BO

    Hi Friends,
    I have created one Custom Module Pool, Business Object and Workflow Definition. In Business Object I have created one Business Event and the event is triggered from Custom Module Pool using function module SWE_EVENT_CREATE. I have created event linkage in transaction SWETYPV and receiver type given Workflow Template No: (WS*) and receiver function Module SWW_WI_CREATE_VIA_EVENT_IBF and checked Event Linkage Active checkbox. Finally I have activated the Triggering Event in the Workflow basic data section. But the Workflow is not getting triggered. Can anyone of you give me a solution for this or tell whether i missed any of the setting for the workflow?
    Regards
    Sujith

    Hi Sujith,
    Did you include a commit work statement after the call to SWE_EVENT_CREATE?
    Regards
    Gareth

Maybe you are looking for

  • How do i authorize my ipod to a new computer?

    how do i authorize my ipod to a new computer? i got a new computer for x-mas and i already had my ipod how do i make sure that when i sync my ipod to my computer it wont delet everything already on my ipod?

  • Customizing request table

    Hi to all Please tell me in which table Customizing requests are stored. So that i can find out which user has generated request with object name. Regards Anubhav

  • Adobe photoshop CS5 quits unexpectedly when opened on lion

    The name sums it up. I don't think I had this problem until I updated to lion. I've read a lot of suggested fixes, including reseting the preferences, however, it runs into the error immediatly after opening, and I never have the option to got to pre

  • Customer Notes using abap Query

    HI Experts, Can any body suggest me abap query for extracting customer notes?? I have to go thru only this option. the text i am supposed to extract is here.......VA42 > goto>header>texts> completion notes .. READ_TEXT is not a solution for me...i ne

  • HT4859 PDF files and audio notes

    My computer due to a virus needed to be reformatted.  Which forced me to have to reset up ITunes on my computer.   I have many very important files on my audio notes app but not see anyway around not lossing them.  I backed them up to iCloud but I gu