Event handling and jeditor

HI, I am having a problem and tied down just because of this.
I have an action listener code that is executed when button is clicked, and here what i do in that
JeditorPane.setPage(URL url)
callToMethod2();
Method2
some calculation
and when i check the length of the document for the jeditorPane it gives me 0
this is because the page is not yet laoded as it contains images.
Actually i want this method2 to be called after whole pages is loaded and displayed
How can i do this
regards

API:
If the document is loaded asynchronously, the document will be installed into the editor immediately using a call to setDocument which will fire a document property change event, then a thread will be created which will begin doing the actual loading. In this case, the page property change event will not be fired by the call to this method directly, but rather will be fired when the thread doing the loading has finished. It will also be fired on the event-dispatch thread. Since the calling thread can not throw an IOException in the event of failure on the other thread, the page property change event will be fired when the other thread is done whether the load was successful or not.
So, don't put your call to method2 after the setPage. Rather, attach a property change listener for "page" to get the event described above, and in the propertyChange method, call method2. See if that works for you.
-JBoeing

Similar Messages

  • RMI, event handling, and Winow.dispose()

    Hi all,
    If you combine RMI with an event handler and java.awt.Window.dispose(), the JVM hangs. The only way to solve this problem is by disposing of the frame from within SwingUtilities.invokeLater.
    Please check the following code:
    ServerInterface.java:_
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ServerInterface extends Remote {
        void Send(ClientInterface CI) throws RemoteException;
    ClientInterface.java:_
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ClientInterface extends Remote {
        void Send() throws RemoteException;
    Server.java:_
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.Naming;
    public class Server extends UnicastRemoteObject implements ServerInterface {
    public Server() throws RemoteException {}
    public void Send (ClientInterface CI)
    try { CI.Send(); } catch (Throwable t){System.out.println(t);}
    public static void main(String args[])
    try {
          Naming.rebind      ( "rmi://localhost:1099/Testing",new Server() );
          System.err.println ("Server ready");
    catch ( Throwable t )
            System.out.println ( t );
    Client.java:_
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.Naming;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    public class Client extends UnicastRemoteObject implements ClientInterface,ActionListener {
    static JFrame A=null;
    static ServerInterface ServerSide;
    private Client()  throws RemoteException {}
    public void Send()
    if ( A == null )
         A = Display("Remove");                   // display frame
    else                                // remove frame
         SwingUtilities.invokeLater ( new Runnable(){public void run(){A.dispose();A=null;}} );
    public static void main(String[] args)
    try {
          ServerSide = (ServerInterface) Naming.lookup ( "rmi://localhost:1099/Testing" );
          ServerSide.Send(new Client());
    catch ( Throwable t )
            System.out.println ( t );
    public void actionPerformed(ActionEvent e)
    try { ServerSide.Send(new Client()); } catch (Throwable t){System.out.println(t);}
    private JFrame Display (String label)
    JButton b = new JButton (label);
    b.addActionListener(this);
    JPanel p = new JPanel ();
    p.add (b);
    JFrame frame = new JFrame ();
    frame.getContentPane().add(p);
    frame.pack();
    frame.setVisible(true);
    return frame;
    }You can do any GUI work from within an event handler, only when you try to dispose of a frame, the system hangs !!!

    Thank you for responding to my problem.
    unless their documentation says otherwise (eg: repaint). I checked the API for "repaint()", but it didn't mention anything about the EDT. What documentation you are referring to ?
    What I don't understand is that why "dispose()" works well on non-RMI systems and hangs the machine on RMI systems ? It even works fine on RMI system providing that you are not disposing of the frame from within an event handler. So the problem occurs only if you are combining the three elements: RMI, event handler, and dispose().
    Conversely, you should avoid doing anything that may take a long time on the EDT. Perhaps remote methods fall into that category.It is true that we should avoid doing anything that may take a long time on the EDT; however, in this particular example, dispose() is not done through a remote call, it is done on the client where the frame should be removed.
    I also tried disposing of the frame from within a normal Thread (instead of the EDT), and it worked just fine.

  • Event handling and inner classes

    Hi everyone,
    When assigning an actionlistener object to a swing component, is making the encapsulating component implement actionlistener better performance-wise than using inner classes? I ask this because my application is pretty slow to start-up, and I'm using lots of inner classes.
    I don't want to go ahead and change the event-handling unless I'm sure it will do any good, because the time restriction is too tight for wasting. Does using addActionListener(this) just pass a reference to itself or is an object generated for each call?
    Thanks in advance,
    Richard

    Passing this only passes a reference. But you won't get a big improvement over inner classes. (If you use one listener object instance and pass that instance to the event sources. Do you?)
    Kurta

  • ICal Event Handling And Exchange

    Okay. I'm having problems figuring out how iCal in Snow Leopard is handling meeting invitations. When I get a new meeting invite in Mail.app and I double-click on it, it creates an event in iCal. If I open that event, the popup gives me the option to click on "Maybe", "Accept", or "Decline". If I click on "Accept" the event window goes away and iCal comes back up.... but it doesn't appear to save my response. If I click on the event, it still shows me the same button options. This would all be fine... except for the following issue....
    As long as an iCal event is in the "invitation" state, I can't change the event from it's default local calendar to the Exchange calendar. I can move it around within local calendars, but the Exchange options are not available from the pulldown menu. If I create a new event manually, then the Exchange options are available from the pulldown and I can move events to it just fine.
    I can't figure out how to get invitations (1) accepted and saved as accepted and (2) moved to the Exchange calendar.
    Anyone have any ideas?

    I've found a work-around that SORT of lets me function for now:
    1) Right click on the event.
    2) Select "Create Duplicate"
    3) Right-click on the new duplicate.
    4) You can now select your Exchange calendar to move it over.
    5) When you try to select the OLD event, iCal will REQUIRE that you send a notification out to the meeting invitees. This is ENTIRELY too inconvenient for me (as I work for Government and Army Colonels do NOT want my meeting spam) so I click on EDIT and then remove all the invitees and then save. This gets around the requirement to send the notice.
    6) THEN I can select the OLD event on my local calendar and delete it.
    This is FAR from a good solution as it requires me to lose all the meeting attendee information AND there's something broken in the requirement to send the meeting notice out again for the duplicate.. but at least I can get events onto my Exchange calendar for now.

  • Menu Design using Event Handler and Containers

    I am going to redesign my menu interface using a Labview Event Structure which has many control on tab pages.  I want to start out doing the correct design approach here.  By registering the front panel controls[] property as an event, I can write event cases for each of the controls on the front panel.  However, I run into difficulty when I have controls on tab pages.  I have attached a VI which shows how I want to set it up.  The event hanlder only fires when I change pages on the tab control. 
    What is a good way to be able to decipher individual controls on the tab control and
    what is the characteristic (label, ref number, etc) that I should be writing the event cases on for good code maintenance? 
    Solved!
    Go to Solution.
    Attachments:
    Generic Menu.vi ‏14 KB

    Looking at your code, you registered for value change events for controls on the front panel, not in the tab control. Use the property node for the tab control to get the references to the pages and for each page get the references for the controls on that page. Build an array of all controls on all pages (or you could separate the registration for each page to make your life easier potentially) and register those controls for value change events. See below...

  • Event Handler and Callback Registration - Business Transaction - SAP Library

    To add a comment, please log in or register on the top of this page and choose Reply. Please write your comment in English.
    You can also go back to the SAP help page.

    Hello,
    To implement any process for BERP.
    1. Tcode BF24 - Create a product. Let's say Z1130.
    2. Tcode BF44 - Create new entry with
    Process - 00001130, FM - ZTEST_1130, Product - Z1130.
    Save Entry.
    3. Tcode BERP - Give Process Interface as 00001130. Run.
    4. You will see one entry. Put cursor on that and Click on Act. Comp.
    5. Here you can see your FM - ZTEST_1130 as Customer product.
    Now, put your relevent code in ZTEST_1130. You can pass tables like
    *" T_BKPF STRUCTURE BKPF
    *" T_BSEG STRUCTURE BSEG
    SO, in your FM, you can get access to data for BKPF and BSEG
    Regards,
    Naimesh Patel

  • Event handler getting fired on all list and libraries

    I have created an event handler and add it to a custom content type. Some how this event handler is getting fired on each every list which are there inside a site. Below is my content type declaration with fields and event handler. This content type
    is being activated using a featur scope at "Site".
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Document (0x0101) -->
    <ContentType ID="0x01010069131024FE3C485FAEF6C36926B5FD67" Name="CIB Document" Group="CIB Content Types" Description="CIB Content Types" Inherits="FALSE" Version="0">
    <FieldRefs>
    <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Hidden="TRUE" Name ="Title"></RemoveFieldRef>
    <FieldRef Name="Metier"
    ID="{F3ABF2F2-437B-4403-8A11-BEAE9F507009}"
    DisplayName="Metier"
    Sealed="TRUE"
    Required="FALSE" />
    <FieldRef Name="Department"
    ID="{0B11D33C-B8D1-485F-A483-755BFE55C2B9}"
    DisplayName="Department"
    Sealed="TRUE"
    Required="FALSE" />
    <FieldRef Name="Owner"
    ID="{FC6FE3D4-5EEE-4812-A77C-499AB9927D1A}"
    DisplayName="Owner"
    Sealed="TRUE"
    Required="FALSE" />
    <FieldRef Name="ExpiryDate"
    ID="{D68E037B-63A2-42FF-8150-412972CB062F}"
    DisplayName="Expiry Date"
    Sealed="TRUE"
    Required="FALSE" />
    <FieldRef Name="SecurityStatus"
    ID="{5954E9C2-921B-46FB-8A7B-2BC0F62BD011}"
    DisplayName="Security Status"
    Sealed="TRUE"
    Required="FALSE" />
    </FieldRefs>
    <XmlDocuments>
    <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
    <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
    <Receiver>
    <Name>CIBDocumentHandlerItemAdding</Name>
    <Type>ItemAdding</Type>
    <Assembly>Common.SharePoint.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=68d03adf96d84a47</Assembly>
    <Class>Common.SharePoint.Web.Handlers.CIBDocumentHandler</Class>
    <SequenceNumber>10500</SequenceNumber>
    </Receiver>
    </spe:Receivers>
    </XmlDocument>
    </XmlDocuments>
    </ContentType>
    </Elements>

    You need to add the ListTemplateId or ListUrl to the Receiver element,
    E.g. If you had a list definition with the template ID 10500, then your event receiver XML would look like this:
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Receivers ListTemplateId="10500" >
    <Receiver>
    <Name>CIBDocumentHandlerItemAdding</Name>
    <Type>ItemAdding</Type>
    <Assembly>Common.SharePoint.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=68d03adf96d84a47</Assembly>
            <Class>Common.SharePoint.Web.Handlers.CIBDocumentHandler</Class>
    <SequenceNumber>10500</SequenceNumber>
    </Receiver>
    </Receivers>
    </Elements>
    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

  • OIM Event handler resistered and Imported but not working

    hi,
    I am using OIM 11g in windows 32 bit envoirnment.
    I have registered a pre precess event handle and also imported it into oim but it's not working. pls find below details.
    DB Entry of MDS_PATHS Table
    1     LastNameEventHandlers.xml     197     196     /tiks/LastNameEventHandlers.xml          DOCUMENT     5          143     http://www.oracle.com/schema/oim/platform/kernel     eventhandlers     1          1          UTF-8     3558973303                    0     0
    DB Entry of plugins table
    2 com.holcim.hssa.eventhandler.LastNmPreProcessEventHandlers     oracle.iam.platform.kernel.spi.EventHandler     1.0     LastNamePreProcessEventHandlers     1
    need tio know where does the eventhandlers goes D:\ORCL_HOME\Oracle_IDM1\server\features this path or else,
    but it's not working

    The eventhandler
    <eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
    <action-handler class="com.holcim.hssa.eventhandler.LastNmPreProcessEventHandlers" entity-type="User" operation="CREATE" name="LastNmPreProcessEventHandlers" stage="preprocess" order="FIRST" sync="TRUE"/>
    </eventhandlers>
    The Plugin
    <oimplugins>
    <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
    <plugin pluginclass="com.holcim.hssa.eventhandler.LastNmPreProcessEventHandlers" version="1.0" name="LastNamePreProcessEventHandlers"/>
    </plugins>
    </oimplugins>
    The handler
    package com.holcim.hssa.eventhandler;
    import java.io.PrintStream;
    import java.util.HashMap;
    import oracle.iam.platform.context.ContextAware;
    import oracle.iam.platform.kernel.spi.PreProcessHandler;
    import oracle.iam.platform.kernel.vo.*;
    public class LastNmPreProcessEventHandlers
    implements PreProcessHandler
    public LastNmPreProcessEventHandlers()
    methodName = "";
    System.out.println("LastNmPreProcessEventHandlers called of NamePreProcessEventHandlers 16 ");
    public boolean cancel(long arg0, long arg1, AbstractGenericOrchestration arg2)
    System.out.println("cancel called");
    return false;
    public void compensate(long arg0, long arg1, AbstractGenericOrchestration arg2)
    System.out.println("getParamaterValue called");
    public EventResult execute(long processId, long eventId, Orchestration orchestration)
    System.out.println("EventResult execute called of LastNmPreProcessEventHandlers 16 ");
    methodName = "execute";
    HashMap parameters = orchestration.getParameters();
    System.out.println((new StringBuilder("Parameters ")).append(parameters).toString());
    String operation = orchestration.getOperation();
    System.out.println((new StringBuilder("Pre Process Operation ")).append(operation).toString());
    if(operation != null && operation.equalsIgnoreCase("create"))
    String firstName = getParamaterValue(parameters, "First Name");
    if(firstName != null && !firstName.trim().isEmpty() && !parameters.containsKey("Middle Name"))
    orchestration.addParameter("Middle Name", firstName.substring(0, 1));
    return new EventResult();
    public BulkEventResult execute(long arg0, long arg1, BulkOrchestration arg2)
    System.out.println("BulkEventResult called of LastNmPreProcessEventHandlers 16 ");
    return null;
    public void initialize(HashMap arg0)
    System.out.println("initialize");
    private String getParamaterValue(HashMap parameters, String key)
    System.out.println((new StringBuilder("getParamaterValue")).append(key).toString());
    String value = (parameters.get(key) instanceof ContextAware) ? (String)((ContextAware)parameters.get(key)).getObjectValue() : (String)parameters.get(key);
    return value;
    private String methodName;
    Also have a question where does it goes after export
    D:\ORCL_HOME\Oracle_IDM1\server\features or elsewhere?

  • HttpContext in itemDeleting Event Handler (works on itemUpdating and itemAdding)

    Hello
    How can I redirect to a custom page in the itemDeleting event handler.
    I don´t know why but the HttpContext is not available in the event handlers.
    My objective is to redirect to some page in the itemDeleting after setting the properties.Cancel = true event handlers and replace/avoid the standard sharepoint error page. For that i need the HttpContext.
    One thing curious is that the following solution works for the itemAdding and itemUpdating and I can access the HttpContext.
    Code Snippet
    public class MyEventHandler: SPItemEventReceiver
    private HttpContext current;
    public MyEventHandler() : base()
    current = HttpContext.Current;
    I hope you can help me solve this problem.
    Thanks for the help.
    Regards,
    André

    Hello all
    The following solved my problem.
    About getting the current httpcontext inside the event handler itemdeleting i have found here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3120467&SiteID=1) a way to get it.
    In my scenario I want to cancel the event handler and redirect the user to a custom page or just avoid the sharepoint error page and return to source page.
    Code Snippet
    public override void ItemDeleting(SPItemEventProperties properties)
    base.ItemDeleting(properties);
    //event handler code
    properties.Cancel = true;
    properties.Status = SPEventReceiverStatus.CancelNoError;
    SPSite site = new SPSite(http://mysiteurl);
    SPWeb web = site.OpenWeb("mywebapplication");
    if (HttpContext.Current == null)
    HttpRequest request = new HttpRequest("", web.Url, "");
    HttpContext.Current = new HttpContext(request, new HttpResponse(new StringWriter()));
    HttpContext.Current.Items["HttpHandlerSPWeb"] = web;
    //to redirect to a custom url just replace the web.Url for a custom one
    SPUtility.Redirect(web.Url, SPRedirectFlags.UseSource, HttpContext.Current);
    Hope this helps,
    Regards,
    André Cunha
    Hello Andre,
    I am trying to add a code on Item Updating event. 
    I am unable to redirect my page to a custom Url. Please help me I tried to set values for Context object still I was unable to redirect to another page. 

  • How to show a message in a form 'PL/SQL Button Event Handler'

    We need validate the sal of an employee, and if it is bigger the value musts
    not be inserted.
    We trying a code like the one shown in the note 134312.1 'HOW TO PASS A
    PARAMETER FROM A PORTAL FORM TO A STORED PROCEDURE' and it works in the insert event of the insert button (using 'PL/SQL Button Event Handler') and it works, but we need to show a message that says the data wasn't inserted. How can we do this?
    The code we used is:
    declare
    v_deptno scott.emp.deptno%type;
    v_empno scott.emp.empno%type;
    v_sal scott.emp.sal%type;
    mySal scott.emp.sal%type;
    v_string varchar2(256);
    blk varchar2(10):='DEFAULT';
    begin
    select sal into mySal from scott.emp where empno=7369;
    v_deptno:=p_session.get_value_as_number(p_block_name=>blk,
    p_attribute_name=>'A_DEPTNO');
    v_empno:=p_session.get_value_as_number(p_block_name=>blk,
    p_attribute_name=>'A_EMPNO');
    v_sal:=p_session.get_value_as_number(p_block_name=>blk,
    p_attribute_name=>'A_SAL');
    v_string:='You just inserted empno: '||to_char(v_empno) ||'to deptno ->
    '||to_char(v_deptno);
    if mySal < v_sal then
    doInsert;
    else
    -- We want to display a message here, when mySal > v_sal
    end if;
    end;
    ----------------------------------

    I did something similar but wasn't using a stored procedure. Couldn't you set a flag variable once you know you're not doing the insert and in the "before displaying the form" section put an IF to check if your flag was set, and if so do an HTP.Print('You are overpaid buddy!');
    Then just reset your flag.

  • Unregister Event Handler OIM 11g

    Hi
    I have created a event handler and registered the same within OIM 11g. it gets executed as expected after create user (post process). next i changed some of the code within my custom event handler. and registered the plugin after i unregistered the old one. unfortunately i still see the old output in my logs
    i have purged the metadata chache, i have bounced the OIM but no luck..
    Are there any steps / checks i need to follow after i unregister the event handler.. and also plz confirm whether we need to follow all the steps of registration of event handler every time we make changes to the event handler class. uhhh.. its really time consuming when
    thanks
    shiv

    Hi,
    Please make sure you are shipping updated JAR files in plugin.zip and re-register.
    Follow below steps to re-register plugin,
    1.     Unregister plugin using below command
    ant -f pluginregistration.xml unregister
    2.     Prepare plugin.zip with updated JAR file.
    3.     register plugin using below command
    ant -f pluginregistration.xml register
    You do not need to restart OIM server after re-register and need not to import eventhandler.xml unless you change version of plugin.
    Also you can verify registered plugin details in plugin table with following query (Run on OIM DB),
    select * from plugins;
    Thanks,
    Pradeep.

  • Debuging Event Handler OIM 11g

    Hi experts
    I have built the event handler and its able to set email of the end user as [email protected] after post process. Fortunatly i could do this at first shot after following the link on the oracle meta link.
    But i could not debug the eventhandler class file for any additional changes. though i have added the SOP statments i cud not see anythin in the OIM Diagnostic logs.
    can any one help me where i can find the trace out put of the SOP's i've set in the event handler.. is it in the WLS logs or do i need to set the OIM log level to finest. im lil confused
    this is the first time im dealing with oim event handlers.

    Hi ,
    By default SOP statments prints on OIM logs.
    You can generate Custom Log file in OIM 11g for event handler.
    1.Open logging.xml from <OIM Domain>/config/fmwconfig/servers/<OIM Server>
    2.In the <log_handlers> tag add entry for custom handler
    3.Add entry for the custom logger under <loggers> tag
    4.Restart the OIM server
    For more details, please see link http://docs.oracle.com/cd/E21764_01/doc.1111/e14308/log.htm#CEGEAGIB .
    Thanks,
    Pradeep
    Edited by: Pradeep Khopade on Jan 30, 2012 10:23 PM
    Edited by: Pradeep Khopade on Jan 30, 2012 10:24 PM

  • PreProcess Event Handler setting default password

    Greetings.
    We developed a custom preprocess event handler and is working fine, but I want to set a default password for a new user using the sentence orchestration.addParameter("Password","defaultpassword") However I got the message :
    <Error> <oracle.iam.identity.usermgmt.impl.handlers.create> <IAM-3050009> <Unknown attribute for entity user.
    oracle.iam.platform.entitymgr.UnknownAttributeException: User : [Password]
    I think that is necesary use a method like setXelleratePassword or something like that.
    How to set a default password in a preprocess event handler associated to the create user event?
    Thanks!

    Hi
    Try with this.
    Use orchestration.addParameter("USR_PASSWORD","defaultpassword")

  • Post Event Handler

    Hi,
    I have created a post event handler and registered it. Then i checked in the PLUGINS table, my event handler exist there. But this event handler never called after create user.
    I have added like:
    <action-handler class="xxxxx"
    entity-type="User" operation="CREATE" name="DBPostProcessEventHandler" stage="postprocess"
    Do I missing any?
    thanks
    Robb

    I've got the same problem, I follwed instruction as in 1262803.1. its ok for pre-process, but for post-process it dosn't work. Did you success?
    I also tried to unregister the pre-process EvenHandler (with command ant -f pluginregistration.xml unregister) I got info "Unregistred succesful" but handler still works.. Do I omit something?
    Regards
    Magda

  • Bug: RichTextEditor "Initialize" not classed as event handler

    I'm trying to load the RichTextEditor control in a popup window. Here's my code:
    var rte:RichTextEditor = new RichTextEditor();
    rte.width   =  600;
    rte.height  =  500;
    rte.title   =  'Edit Text';
    I need to add the initialize event handler so I can add a button to the toolbar (as per the example on the Adobe website).
    However, when I type:
    rte.initialize  =  "addSaveButton()";
    Flash Builder says this is invalid as "initialize" is actually a function and doesn't accept any parameters.
    Compare this with:
    <mx:RichTextEditor initialize="addSaveButton()"/>
    Flash Builder recongises "initialize" as an event handler and therefore accepts the addSaveButton() function.
    Can anyone else confirm whether this is a bug with the SDK or not? I can simply add the button outside of the RTE for now, but then I'd have to wrap the RTE in a separate panel to accomodate the button, which isn't ideal.
    Thanks in advance.

    Hi,
    this is how to add the event listener
    rte.addEventListener(FlexEvent.INITIALIZE,addSaveButton);
    David.

Maybe you are looking for