How to fire an event  with a non-AWT/Swing class?

Hi, Everybody,
I have an object that parse an XML file. When I meet an element with the value "true", I would like to fire an event, for instance a KeyEvent, just like a special key is pressed.
Could you provide me an example?
Thanks.
Youbin

use the firepropertychange methods as you do in beans.
iam giving an eg.
class abc
    MyListener lis;
    addMyListener(MyListener lis)
        this.lis = lis;
    abc()
        lis.fireEvent(new MyEvent("Class Instantiated"));
class MyEvent extends EventObject
    String e;
    MyEvent(Object src)
        super(src);
    MyEvent(String e)
        this.e = e;
interface MyListener
    public void fireMyEvent(MyEvent e);
}You can use this methedology.Any class implementing MyListener will the be notified of the event and your class abc can now generate events wherever it wants just like i fired an event during initialization.
you can also use observable/observer to achieve the same.

Similar Messages

  • How to fire an event dynamically in JSF Page

    Hi All
    How to fire an event dynamically in JSF Page?
    Thanks
    Sudhakar

    Hi,
    Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
    In otherwords,
    If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
    Hope you understand
    What is the role of MethodBinding mechanism here??
    Thanks
    Sudhakar Chavali

  • How to share a project with a non-Adobe user and present it to prospect customers?

    I Have to share my project with a person who will present it to prospect customers. I cannot ask this person to open an Adobe account. Is there a way for him to access my DPS folio and show it? Or can I export it in a way that allows to appreciate the interaction features built inside?
    Thanks!

    OK, got it. Thank you!
    2015-01-17 14:46 GMT+01:00 Bob Levine <[email protected]>:
        How to share a project with a non-Adobe user and present it to
    prospect customers?  created by Bob Levine
    <https://forums.adobe.com/people/BobLevine> in Digital Publishing Suite
    - View the full discussion
    <https://forums.adobe.com/message/7105349#7105349>

  • How to fire another event handler for postprocess stage

    Hi All,
    I have 3 custom event handlers for postprocess stage, for modify action on user object. The problem is tah only one event handler is executed - I use EntityManager API to modify user object. How to fire another event handlers? Do I have use UserManager API?
    best
    mp

    As Bikash stated, used a single event handler. You can put if statements in there to identity the operation, as well as if statements if the parameter is found i the list of attributes being modified. This way you will only perform the action when necessary.
    -Kevin

  • JDev 10.1.3 ADF: How to fire an event when clicking a Radio Button

    I have a <af:table> component with the following code for my radio button
    <af:tableSelectOne text="Select and"
    binding="#{backing_viewFees.tableSelectOne1}"
    id="tableSelectOne1"
    attributeChangeListener="#{backing_viewFees.tableSelectOne1_attributeChangeListener}"
    autoSubmit="false">
    When I click the radio button it does not fire up my event in my backing bean?

    Thank you for the suggestion...it does work and fires the event, but it is still not selecting the current record when I try to perform an Update or Delete.
    I had to modify your code a bit in order for it work in JDev 10...used the JUCtrlValueBindingRef instead of the FacesCtrlHierNodeBinding.
    Here is what my af:table tag looks like:
    <af:table value="#{bindings.FeesView1.collectionModel}"
    var="row" rows="#{bindings.Fees001View1.rangeSize}"
    first="#{bindings.FeesView1.rangeStart}"
    emptyText="#{bindings.FeesView1.viewable ? \'No rows yet.\' : \'Access Denied.\'}"
    selectionListener="#{backing_viewFees.tableSelectOne1_attributeChangeListener}"
    binding="#{backing_viewFees.table1}" id="table1">
    If I put back my 2 original attributes, then my Delete and Updates work.
    selectionState="#{bindings.FeesView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.FeesView1.collectionModel.makeCurrent}"
    Here is my code in the backing bean:
    public void tableSelectOne1_attributeChangeListener(SelectionEvent selectionEvent) {
    JUCtrlValueBindingRef binding = (JUCtrlValueBindingRef)this.getTable1().getSelectedRowData();
    if (binding != null) {
    Row currentRow = binding.getRow();
    if (currentRow != null) {
    System.out.println(currentRow.getAttribute("CurrentRecordInd")); // this does print my selected value!!!!
    }

  • How to create contextual event with custom payload?

    I use the following code to invoke contextual event from my region via the "action-listener" of a command-link:
    <af:commandLink text="#{row[def.name]}" id="cl1"
    styleClass="tableLinkActive"
    actionListener="#{backingBeanScope.PanelToConveroFormManager.handleSelectedRow}">
    The following "action-listener" is designed to pass the current selected record key to the "consumer" of the contextual event:
    public void handleSelectedRow(ActionEvent actionEvent) {
    String currentRecordKey = getCurrentRecordKey();
    JUEventBinding eventBinding = (JUEventBinding)BeanUtils.getBindings().get("RefreshParentEvent");
    if (eventBinding != null) {
    ActionListener actionListener = (ActionListener)eventBinding.getListener();
    actionListener.processAction(actionEvent);
    How do I pass the "currentRecordKey" value as a custom "payload" via the event-binding "RefreshParentEvent" in the above code?
    Is there any code example on using contextual event with custom payload?

    Hi,
    the custom payload is referenced when you set up the event itself. You use EL in the custom payload definition to point to a managed bean method that when called accesses the current rowKey. The Java code you show just passes the ActionEvent of the ADF Faces command button and invokes the event. It does not manipulate the event definition.
    <eventBinding id="eventBinding"
                      Listener="javax.faces.event.ActionListener">
          <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
            <event name="testEvent"
                   customPayLoad="#{mymanagedBean.rowKey}"/>
          </events>
        </eventBinding>Frank

  • How to Fire an Event whenever clicking to Tab A, B, C on the JTabbedPane

    I have created a screen by using JTabbedPane having A,B,C Tabs on it. I need to fire one event whenever I will be clicking on Tab B or C or vice-versa. So that I can display some values from database automatically whenever I will choose Tab B or C.

    What's wrong with the events that are already fired when that happens? Add a ChangeListener to the JTabbedPane and it will receive a ChangeEvent every time a different tab is selected.

  • How to fire an event?

    Hello guys! I came across a big problem this morning, please help me!
    I'm thinking about defining an event, which is supposed to extend AWTEvent, so as to help communicating between two beans. However, when I have almost started, I find I completely have no idea about how to dispatch an event, though I have used Listeners many times!
    I'll be very grateful if you'll kindly give me some hints. Thank you!

    Dispatching an event is basically just a method call.
    All the listeners implement some listener interface, right? And those interfaces invariably define a method that takes an event object and has no return value (i.e., it's void).
    So basically you create that event object and call then call the method on those listeners.

  • Urgent !!!!  How to fire an event using InputSelect DataTag

    I am using InputSelect DataTag in my JSP client. I want to fire
    onChange event like javascript. So please guide me in this ...

    I wanted seem. Couldn't find a way. So, gave up to use Oracle
    tag and backed to Html standard tag(<input....>).

  • How to assign the events in a specific method in class builder(se24)

    i have declared one event in event part.i want to asign the event to one method .can any one help me .i have to do it in se24.pls

    hi,
    create a class in se24.
    <b>click the <b>EVENTS</b> tab, define an event.</b>
    <b>click the <b>METHODS</b> tab, define a method to trigger/ raise the event</b>
    <b>define one more method as an event handler method for the event.</b>
    for a method to be an event handler, click on the detail view,
    select the check box <b>Event Handler for</b>  give the classname where the event is defined and the event name, click on Change button.
    <b>event can be in the same class or different from that of the event handler method.</b>
    don't forget to <b>register the event handler method in the program.</b>
    click the code button of ur trigger method(meth2 in my example) and write there,
    raise event evt1.
    now your class is ready.
    now in se38 program,
    declare a reference variable to ur class,
    create an object,set the handler for ur event,
    call the trigger method
    <b>data:oref type ref to zsowcl1.
    create object oref.
    set handler oref->meth1 for oref.  handler method
    call method oref->meth2.           raise evnt method</b>
    hope it gives  you clear idea,
    Regards,
    Message was edited by:
            sowjanya s

  • Fire EPCF event with WD ABAP in EP

    In EP 7 I want to fire an EPCF event. I use the code below. A similar example from WD java works, but here I never receive the event. The Javascript part is right since it works together with an HTML and WD Java iView. Only the WD example is not working. Any hints?
    ABAP ("triggered by a button")
    DATA:
      L_API_COMPONENT TYPE REF TO IF_WD_COMPONENT,
      L_PORTAL_MANAGER TYPE REF TO IF_WD_PORTAL_INTEGRATION.
    L_API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).
    L_PORTAL_MANAGER = L_API_COMPONENT->GET_PORTAL_MANAGER( ).
    L_PORTAL_MANAGER->FIRE( PORTAL_EVENT_NAMESPACE = 'urn:xxDemo' PORTAL_EVENT_NAME = 'simpleevent' PORTAL_EVENT_PARAMETER = 'HelloFromABAP' ).
    JavaScript:
    EPCM.relaxDocumentDomain();
    EPCM.subscribeEvent('urn:xxDemo', 'simpleevent', handle_simpleevent_Event);

    Good hint, it was not the domain, but the protocol (http/https).
    One iView was on https while the other one was setup for http.
    However, now the question is: Can I setup EPCF somehow to work with mixed http/https IViews. In my HTML page I can use EPCMProxy, but I have no idea how to change this on a WD ABAP.
    Regards

  • 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

  • How to make different events with different colors on calendar, on my new iPad

    how to make events on calendar with different colors ?

    Sergio,
    The color of an event is dictated by the color assinged to the calendar it's on.
    Tap Calendars then tap Edit to either changed the color of an existing calendar or to add a new one.
    Matt

  • How to fire an event from Java Script

    Hi,
    Here is my problem: using JSF
    I have a selectOneMenu list box when a value changes a valueChangeListner event is fire that all works great now the problem I'm able to add items to the list from a popup form using Java Script but I need the valueChangeListner to fireup every time I add a item any ideas how to do that
    Thanks

    Just do form.submit().

  • How to adjust mouse event with scaled DesktopPane

    Hi
    I am manjunatha, i am developing Data warehouse product, in this, i am showing inter-related Transforms in desktop pane, i given option to view the content of desktop pane with different scaled factor (ex 100%,50%,25%), when i will scale the content of desktop pane using Graphics class, only content will be scaled, but the events on the Internal frames will be referring 100% view only,(ie mouse event will not effected by scaled factor, so it will be point to 100% view points only, ex at first an Internal Frame will have bounds(10,10,200,200), after i will scale this to 10%, it will be drawn with (1,1,20,20) on the desktop pane, but internally its bounds will be (10,10,200,200) and mouse event will detect Internal Frame at (10,10,200,200) location , instead of scaled (1,1,20,20) location.
    My question is how can i scale the Internal Frames and adjust relevant events to it?
    (You can see screen shot of this page with (Mapplet View as screen name)
    At www.MyDataWarehousing.com)

    Did you ever find a solution to this? How did you scale all the components on resize?

Maybe you are looking for