Event handling question

I am very new to Swing....I am very confused about how event handling works. I created a button called "remove" and a list. When a user selects an item in the list and then clicks on the remove button, then the item should be deleted from the list. I am able to display the list and the button. I create a listener for the button in a separate class as follows:
class MyActionListener implements ActionListener
public void actionPerformed (ActionEvent e)
if(e.getActionCommand().equals("remove"))
{System.out.println("remove works");
Now my problem is ..how do i access the list in this class..because my list is set up in the other class (main class). Because if i try to do anything with the list in this class it shows the compile time error saying it cannot identify what list is. Please tell me how i can use the list in the MyActionListener class. Here is the code that sets up the list:
public abstract class VetNet extends JFrame implements ListSelectionListener
static DefaultListModel listM= new DefaultListModel();
static DefaultListModel listModel;
public static void main (String[] args)throws IOException
JPanel panel= new JPanel();
JLabel j=new JLabel("Welcome");
panel.add(j,BorderLayout.NORTH);
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer reader;
reader=new StringTokenizer(stdin.readLine());
String first_name=reader.nextToken();
while(!first_name.equals("end"))
{ String last_name=reader.nextToken();
add_name(first_name,last_name);
reader=new StringTokenizer(stdin.readLine());
first_name=reader.nextToken();
}//while
DefaultListModel listModel=new DefaultListModel();
listModel=return_fname();
String first= (String)(listModel.firstElement());
JList sampleJList= new JList(listModel);
sampleJList.setVisibleRowCount(2);
// sampleJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
//sampleJList.setSelectedIndex(0);
//sampleJList.addListSelectionListener(sampleJList);
JScrollPane listPane=new JScrollPane(sampleJList);
panel.setBorder(BorderFactory.createEmptyBorder(60,60,30,60));
panel.add(listPane);
JButton b1=new JButton("add");
panel.add(b1);
JButton b2=new JButton("remove");
panel.add(b2);
JButton b3=new JButton("edit");
panel.add(b3);
JFrame frame = new JFrame ("VetNet");
frame.getContentPane().add(panel);     
frame.addWindowListener(new WindowAdapter() {
     public void windowClosing (WindowEvent e) { System.exit(0); }
frame.pack ();
     frame.setVisible(true);
//MyActionListener myListener= new MyActionListener();
b1.addActionListener(new MyActionListener());
b2.addActionListener(new MyActionListener());
b3.addActionListener(new MyActionListener());
//sampleJList.addActionListener(new MyActionListener());
}//main
private static void add_name(String f_name, String l_name)
listM.addElement(l_name+ ", " + f_name);
}//method add_fname
private static DefaultListModel return_fname()
return listM;
}//method return_fname

Ok! This is the LONG answer, but I think you would benefit from reading it all.
Making something public means that it can be accessed from other classes; however, it must be accessed using an object(instance) of that class. This means, if I have a class MyJFrame that extends JFrame, then in another class, I can do this:
MyJFrame myFrame = new MyJFrame();
myFrame.dispose();
myFrame.isShowing = false;
Given that dispose() is a public method and isShowing is a public boolean variable that's in the MyJFrame object. Note: the opposite of public is private meaning that the variable/function is only accessible within the class. Also, in all my examples, I assume each class has access to the others.(in same Package, or imported)
There are times at which you do not want to call a function on a given object or you want variables that are defined in the CLASS context, not the OBJECT context. As in, I have the class MyJFrame, and I always want to be able to access every object(instance) of this class that I've created. I would accomplish this using a static variable. Define the variable the same place you would define any other variable of the class, but inclued the reserved word "static". As in:
public class MyJFrame{
public static Vector allFrames = new Vector();
then in my contructor, I would add this frame to the vector:
public MyFrame(){
allFrames.add(this);
Now that I have this set up, I can access all the frames I've made from anywhere using MyJFrame.allFrames (note that I use the CLASS name, and I don't have an instance of the object anywhere)
Another use of static is for functions. Going along with the same example, I could add a closeAllJFrames function:
public static void closeAllJFrames(){
for(int x=0; x<allFrames.size(); x++){
allFrames.elementAt(x).dispose();
then I can call this function from any other class using: MyJFrame.closeAllJFrames();
Also worth noting, this function could be placed in any other class(other than inner classes, which cannot have static functions), you'd just need to put MyJFrame. in front of the allFrames.
One last tip is: If you use code like I've shown, consider using a Hashtable instead of a Vector if you need to access certain frames(or whatevers) from afar. This will keep you from iterating thru the Vector and will decrease overhead significantly.
Hope this helps
--Zephryl

Similar Messages

  • Event Handling Question! Please help me!

    can a JTextField component generate a KeyEvent? Is it possible for the class used to create JTextField object implements KeyListener and fufilled a keyTyped or a keyPressed method created by a keyListener interface

    The best way to find answers to questions like these is to search the API. Near the top of this page is a drop down for APIs, or go here for 1.5 API http://java.sun.com/j2se/1.5.0/docs/api/
    In the API frame look for JTextField and see if it implements a method, or inherits a method that will add a KeyListener. If it does, then the answer to your question is yes.
    Depending on what you want to do, it might be better to use a custom Document instead of a KeyListener.

  • Beginners Questions about Multiple JPanels in JFrame and event handling

    I am a newbie with SWING, and even a newerbie in Event Handling. So here goes.
    I am writing a maze program. I am placing a maze JPanel (MazePanel) at the center of a JFrame, and a JPanel of buttons (ButtonPanel) on the SOUTH pane. I want the buttons to be able to re-randomize the maze, solve the maze, and also ouput statistics (for percolation theory purposes). I have the backbone all done already, I am just creating the GUI now. I am just figuring out EventHandlers and such through the tutorials, but I have a question. I am adding an ActionListener to the buttons which are on the ButtonPanel which are on JFrame (SOUTH) Panel. But who do I make the ActionListener--Basically the one doing the work when the button is pressed. Do I make the JFrame the ActionListener or the MazePanel the ActionListener. I need something which has access to the maze data (the backbone), and which can call the Maze.randomize() function. I'm trying to make a good design and not just slop too.
    Also I was wondering if I do this
    JButton.addActionListener(MazePanel), and lets say public MazePanel implments ActionListenerdoesn't adding this whole big object to another object (namely the button actionlistener) seem really inefficient? And how does something that is nested in a JPanel on JFrame x get information from something nested in another JPanel on a JFrame x.
    Basically how is the Buttons going to talk to the maze when the maze is so far away?

    I'm not an expert, but here's what I'd do....
    You already have your business logic (the Maze classes), you said. I'm assuming you have some kind of public interface to this business logic. I would create a new class like "MazeGui" that extends JFrame, and then create the GUI using this class. Add buttons and panels as needed to get it to look the way you want. Then for each button that does a specific thing, add an anonymous ActionListener class to it and put whatever code you need inside the ActionListener that accesses the business logic classes and does what it needs to.
    This is the idea, though my code is totally unchecked and won't compile:
    import deadseasquirrels.mazestuff.*;
    public class MazeGui extends JFrame {
      JPanel buttonPanel = new JPanel();
      JPanel mazePanel = new JPanel();
      JButton randomizeB = new JButton();
      JButton solveB = new JButton();
      JButton statsB = new JButton();
      // create instanc(es) of your Maze business logic class(es)
      myMaze = new MazeClass();
      // add the components to the MazeGui content pane
      Component cp = getContentPane();
      cp.add(); // this doesn't do anything, but in your code you'd add
                // all of your components to the MazeGui's contentpane
      randomizeB.addActionListener(new ActionListener {
        void actionPerformed() {
          Maze newMaze = myMaze.getRandomMazeLayout();
          mazePanel.setContents(newMaze); // this is not a real method!
                                          // it's just to give you the idea
                                          // of how to manipulate the JPanel
                                          // representing your Maze diagram,
                                          // you will probably be changing a
                                          // subcomponent of the JPanel
      solveB.addActionListener(new ActionListener {
        void actionPerformed() {
          Solution mySolution = myMaze.getSolution();
          mazePanel.setContents(mySolution); // again, this is not a real
                                             // method but it shows you how
                                             // the ActionListener can
                                             // access your GUI
      // repeat with any other buttons you need
      public static void main(String[] args) {
        MazeGui mg = new MazeGui();
        mg.setVisible(true);
        // etc...
    }

  • Question about event handling in JComponents

    I have often found it useful to create a component that acts as an event handler for events the component generates itself. For example, a panel that listens for focus events that effect it and handle these events internally. (See below).
    My question is: Can this practice cause synchronization issues or any other type of problem that I need to watch out for? Is it good/bad or neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff
    }

    Hi,
    Handling events this way is completely fine and saves on number of classes. Only thing you may want to watch out for is that the handler methods have to be public. This means that someone could use your component and call one of the methods. For example, I could write:
    panel.focusGained(new FocusEvent(....))
    when it's not really gaining focus. So, if you're writing this component for re-use you might want to be aware of this.
    An alternative:
    Use a single internal class to handle all events. It can then delegate to private methods of your component. Example:
    class MyEventHandler implements FocusListener, MouseListener, etc... {
    public void focusGained(FocusEvent fe) {
    doFocusGained(fe);
    public void mousePressed(MouseEvent me) {
    doMousePressed(me);
    Then your component could have:
    private void doFocusGained(FocusEvent fe) {
    private void doMousePressed(MouseEvent me) {
    etc...
    Just ideas :)
    Thanks!
    Shannon Hickey (Swing Team)
    I have often found it useful to create a component
    that acts as an event handler for events the component
    generates itself. For example, a panel that listens
    for focus events that effect it and handle these
    events internally. (See below).
    My question is: Can this practice cause
    synchronization issues or any other type of problem
    that I need to watch out for? Is it good/bad or
    neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements
    FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff

  • Question related to PO Event Handler

    Hi Experts
    I am facing issues related to PO Header Event Handler:
    1. When I make change to Statistical Delivery Date under Delivery Schedule tab in ECC, The PO Header EH is getting deleted in EM. May I know the reason behind this? Please suggest how to avoid this.
    2. When I am deleting one of PO Items, the PO Header EH is also getting deleted in EM. When I undelete the PO Item, my PO Item EH is active again but PO Header Eh is still in deleted status. Please suggest how to correct this.
    I really appreciate your quick answers to this.
    Regards
    Ravi

    Hi Steffen
    When we tried to analyse through debugging, for the first issue, we found that the standard application tables PURCHASE_ORDER_HEADER_NEW and PURCHASE_ORDER_HEADER_OLD delivered by SAP for BPT ESC_PURORD, are not having the value D for DeleteVal. column. When we have put this manually for testing purpose, the issues are resolved. But we do not know the impact of putting this value here as standard SAP did not deliver it that way.
    When we observed tables of other BPT, this value D is there. Please throw some light on this before we go ahead and make changes.
    Thanks
    Ravi

  • Question on program structure about event handling in nested JPanels in GUI

    Hi All,
    I'm currently writing a GUI app with a wizard included in the app. I have one class that acts as a template for each of the panels in the wizard. That class contains a JPanel called contentsPanel that I intend to put the specific contents into. I also want the panel contents to be modular so I have a couple of classes for different things, e.g. name and address panel, etc. these panels will contain checkboxes and the like that I want to event listeneres to watch out for. Whats the best way of implementing event handling for panel within panel structure? E.g for the the checkbox example,would it be a good idea to have an accessor method that returns the check book object from the innerclass/panel and use an addListener() method on the returned object in the top level class/panel. Or is it better to have the event listeners for those objects in the same class? I would appreciate some insight into this?
    Regards!

    MyMainClass.main(new String[] { "the", "arguments" });
    // or, if you defined your main to use varags (i.e. as "public static void main(String... args)") then you can just use
    MyMainClass.main("the", "arguments");But you should really extract your functionality out of the main method into meaningful classes and methods and just use those from both your console code and your GUI code.

  • UIX-XML BC4J Question regarding event handling

    How can I use/access Application Module, defined in UIX-XML page (using <bc4j:registryDef>), in my event handler method ???

    Sorry for the confusion. I figured out what you were asking.
    The right way is this.
    First, in your UIX XML page, declare your handler like this:
    <event name="%myEvent%" >
    <bc4j:findRootAppModule name="%ModuleName%" >
    <method class="%eventclass%" method="%eventmethod%" />
    </bc4j:findRootAppModule>
    </event>
    the strings in the % have to be replaced with your own particular names. %ModuleName% should be the same as the name of the module in the registry.
    Then in the event handler %eventclass%.%eventmethod% you can use this to find the Application Module:
    oracle.jbo.ApplicationModule mymodule
    = oracle.cabo.data.servlet.bind.ServletBindingUtils.getApplicationModule(context);
    "context" is passed in to your event handler as a BajaContext. ServletBindingUtils has several other methods for getting BC4J stuff, you should look at its definition.
    Joe

  • Javascript embedded in button pl/sql event handler not being executed

    Javascript calls not working from pl/sql button event handler. What am I missing? Are specific settings needed to execute javascript from pl/sql proceedures?
    Example: Want to toggle target='_blank' off and on in a button pl/sql event handler to open url call in new window & then reset when processing submit is done & the app returns to the form.
    portal form button's pl/sql submit handler:
    begin
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    end ;
    Putting the following in the button's javascript on_click event handler works great:
    this.form.target='_blank'
    to force opening new window with a call in the button's submit pl/sql code via:
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    but then the target='_blank' is left on when the submit is done & we return to the form.
    putting the above javascript as a function (called fcn_newpage) elsewhere (e.g., after form opens) & calling in the submit pl/sql with
    htp.p('fcn_newpage') ;
    also doesn't work.
    Metalink thought this was an application issue instead of a bug, so thought I'd see if anyone knows what's going wrong here. (Portal 9.0.4.1)

    thanks for your discussion of my post.
    Please clarify:
    "htp.p('fcn_newwindow') sends a string":
    What would you suggest the proper syntax for a function fcn_newwindow() call from a pl/sql javascript block that differs from
    htp.p('<script language="Javascript">') ;
    htp.p('fcn_newwindow');
    htp.p('</script>');
    or more simply
    htp.p('fcn_newwindow') ;
    More generally, what I'm trying to figure out is under what conditions javascript is executed, if ever, in the pl/sql of a button (either the submit or custom event handler, depending on the button).
    I've seen lots of posts asking how to do a simple htp.p('alert("THIS IS TROUBLE")') ; in a pl/sql event handler for a button on a form, but no description of how this can be done successfully.
    In addition to alerts, in my case, I'd like to call a javascript fcn from a pl/sql event handle that would pass a URL (e.g., http://www.oracle.com) where the javascript fcn executed
    window.open(URL). The API call to set_target(URL) in pl/sql has no ability to open in a new window, so calling that is inadequate to my needs and I must resort to javascript.
    Its clear in the PL/SQL of a button, you can effect form components since p_session..set_target & p_session.get_target set or get the contents of form components.
    So to see if javascript ever works, I tried to focus on something simple that only had to set what amounts to an enviromental variable when we returned to the form after a post. I chose to try to change the html value of TARGET from javascript in the PL/SQL button because it doesn't need to be implemented until we finish the post and return to the form.
    So I focused on a hack, setting this.form.TARGET='_blank' in the on_click event handler that forced every subsequent URL call or refresh of the form to be a new window. I then wanted to turn off opening new windows once I'd opened the URL call in a new window by setting TARGET='' in the portal form. I can achieve what I want by coding this.form.TARGET='' in the javascript (on_focus, on_change, or on_mousedown, ...) of every form component that might refresh the form. However, that is a ridiculous hack when a simple htp.p('<script>') ; htp.p('this.form.target=""') ; htp.p('</script>') ; at the end of the button's pl/sql event handle should do the same thing reliably if javascript ever works in the pl/sql event handler.
    If we didn't have access to form components through p_session calls, I'd assume it was a scope issue (what is available from the pl/sql event handler). But unless my syntax is just off, when, if ever, can javascript be used in a portal form's pl/sql event handler for a button?
    if I code a javascript funtion in the forms' pl/sql before displaying form:
    htp.p('<script language="JavaScript">') ;
    htp.p('function fcn_new_window(URL)') ;
    htp.p('window.open(URL)' ) ;
    htp.p('</script>') ;
    the function can be called from a button's on_click javascript event handler:
    fcn_new_window('http://www.oracle.com')
    but from the same button's pl/sql submit event handler this call doesn't work: htp.p('fcn_new_window("http://www.oracle.com")')
    So my questions remain: Is there other syntax I need, or does javascript ever work properly from the pl/sql of a form button's event handler? If it doesn't work, isn't this a bug that should be fixed by Oracle?
    I can probably figure out hacks to make things work the way I need, but executing javascript from pl/sql event handlers seems to be the expected way to affect portal html pages (forms, reports, ...) and it seems not to work as expected. I don't feel I should have to implement hacks for something as simple as calling a javascript function from pl/sql when almost every example I've found in metalink or the forums or Oracle Press's "portal bible" suggests using javascript from pl/sql via the utility htp.p() to effect web page components in portal.
    My TAR on the subject, while still open, returned the result basically: "We can reproduce your situation. Everything looks okay to us, but we can't explain how to use javascript where you want or point you to any documentation that would solve your problem or expain why it should not work the way you want it to. We don't feel its a technical issue. Why don't you post the problem on the portal applications forum."
    I'm hoping I'm just missing something fundamental and everything will work if I implement it a little differently. So if anyone sees my error, please let me know.
    by the way, not sure this is germain, but in reference to your comment:
    "redirections in pl/sql procedures give a peculiar result. in a pl/sql procedure, usually, portals give the last redirection statement and ignore anything else coming after it."
    if I try to raise an alert:
    htp.p('alert("you screwed up")');
    return;
    in a pl/sql event handler, it still doesn't raise the alert, even though its the last thing implemented in the event handler. But if I set the value of a text box using p_session..set_value_as_string() at the same spot, it correctly sets the text box value when I return to the form.

  • Can File Based events Handle wildcards in the filename

    The question was can file events handle wildcards in the filename? That way, the object scheduled to handle the event can query the file event specifics and process accordingly. The impact is that we will have to create a file event for every event type for every pathway/state. Therefore, in a worst case scenario, if there are 3 event types for every state, i.e., end of day, end of week, and end of month, and there are 50 pathways/states, then there would be 50 *3 or 150 total file events that would have to be entered. If BOE can handle file event wildcarding, then we need only one event.can we do that ???
    Edited by: sanfrancisco on Nov 18, 2010 5:20 PM

    Hi
    As per my knowledge events will not Handle wildcards in the filename
    Regards
    Ashwini

  • OIM 11.1.1.5: Post Process Event Handler, change password notification

    Hi,
    Products
    OIM 11.1.1.5 BP02
    OAM 11.1.1.5
    OID 11.1.1.5
    Problem
    I have written a post-process event handler which fires when a role is assigned to a user. The event handler calls a plugin which uses the UserManager API to generate and change the user's password.
    I've tested this by assigning a role to the user via the OIM web console. I can see my log messages indicating that the event handler has fired and that the password has been changed.
    However, I expected that when UserManager.changePassword completed, a notification email would then be sent to the user informing them of the new password, but no notification email has been sent.
    The email notifications have been set up correctly, because I have changed the same user's password via the OIM web console and successfully received a Reset Password email.
    So, my questions are:
    1) Am I right in thinking that when you call UserManager.changePassword(), an out-of-the-box ResetPassword email notification should be sent to the user?
    2) Has anyone got this working in 11.1.1.5?
    Some more detailed info
    In my plugin class I'm calling the following from both execute methods (EventResult and BulkEventResult):
    char newpasswd[] = new RandomPasswordGeneratorImpl().generatePassword(user);
    getUserManager().changePassword(userKey, newpasswd, false, null, true);
    logger.info(("Successfully changed password"));
    plugin.xml
         <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
         <plugin
         pluginclass="oracle.iam.PostInsertPlugin"
         version="1.0"
         name="PostInsertPlugin">
         </plugin>
         </plugins>
         </oimplugins>
    $OIM_HOME/server/bin/weblogic.properties
              wls_servername = oim_server1
              app = OIMMetadata
              metadata_from_loc=/home/oracle/eventhandlers
              metadata_file=/metadata/roleuser/custom/EventHandlers.xml
    /home/oracle/eventhandlers/import/metadata/roleuser/custom/EventHandlers.xml
    <?xml version='1.0' encoding='utf-8'?>
    <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="oracle.iam.PostInsertPlugin"
    entity-type="RoleUser"
    operation="CREATE"
    name="PostInsertPlugin"
    stage="postprocess"
    order="1002"
    sync="TRUE"/>
    </eventhandlers>
    There are no errors in the OIM out and diagnostic logs apart from the following which occur at OIM startup:
    [2013-01-07T16:29:23.425+00:00] [oim_server1] [ERROR] [IAM-0080075] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: oiminternal] [ecid: 2e903d7ef060ab65:66b2de91:13c15d6d9ce:-8000-0000000000000002,0] [APP: oim#11.1.1.3.0] XML schema validation failed for XML /metadata/iam-features-OIMMigration/EventHandlers.xml and it will not be loaded by kernel.
    [2013-01-07T16:29:24.267+00:00] [oim_server1] [ERROR] [IAM-0080075] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: oiminternal] [ecid: 2e903d7ef060ab65:66b2de91:13c15d6d9ce:-8000-0000000000000002,0] [APP: oim#11.1.1.3.0] XML schema validation failed for XML /metadata/iam-features-callbacks/event_configuration/EventHandlers.xml and it will not be loaded by kernel.
    Thanks
    dty
    Edited by: oim_user on Jan 7, 2013 5:37 PM

    No notification will be sent if you changepassword using the method from usermanager api.
    You have to trigger the resetpassword event manullay in your code.
    Here is a sample code to create an event for reset password. Once you create event, invoke it from notification service - notify method.
    NotificationEvent event = new NotificationEvent();
    String[] receiverUserIds= {userLogin};
    event.setUserIds(receiverUserIds);
    event.setTemplateName("ResetPasswordNotification");
    event.setSender(null);
    HashMap<String, Object> resolvedData = new HashMap<String, Object>();
    resolvedData.put("userLoginId", userLogin);
    event.setParams(resolvedData);

  • Event handling in LOV

    Hi There,
    We have a use-case where we need intercept the event of af:inputComboboxListOfValues component.
    I have table, which has three columns, Name, Description and Label.
    I have a LOV on Name column.
    When user change the value of Name column by selecting an value from dropdown, I need to do business validation, I show user the "Yes/No" popup with warning message, and base on the user's choice, either proceed with the change or stop the change.
    My problem is that I am unable to find a appropriate event to show the popup.
    I know there are several events in the af:inputComboboxListOfValues component, launchPopupEvent, returnPopupEvent and valueChangeEvent.
    1. If I show popup on launchPopupEvent, after the user click "Yes/No" button on the popup, the page will be refreshed and dropdwon doesn't show the item list.
    2. returnPopupEvent and valueChangeEvent event will be handled by framework in one request, there is no chance for user's interaction.
    I am not familiar with ADF event handling machenism, can anyone help me?
    Thanks in advance.
    Thunder
    Edited by: 984466 on 2013-3-7 下午4:59
    Edited by: 984466 on 2013-3-8 上午12:51

    Hi,
    first of all, never post questions regarding internal JDeveloper builds (11.1.1.7 is not released to public) on this public forum. You are from Oracle and therefore have internal channels for this (note that using internal builds the problem could be with the build and not necessarily the code alone).
    To your question:
    I don't understand why
    +"2. returnPopupEvent and valueChangeEvent event will be handled by framework in one request, there is no chance for user's interaction."+
    doesn't work. If you set the "name" column component to autosubmit="true" then the listener fires as soon as you move out of the field and you can raise the alert. The current row in the binding points to the row you changed the name for and as such the value can be unset (the value change listener shows you the before and after value)
    Frank

  • Event Handling in C API

    Does Internet Directory C API supply the event handling like those in JNDI? Actually Netscape Directory/IBM Secuway Directory supply this features for C SDK, why Oracle Directory Server do not supply it?
    Thanks,
    Peter

    Hello Peter:
    Have you seen the "Oracle Internet Directory v2.1.1 Application Developers guide"? In chapter 2 there is a section on error handling. Let me know if this answers your question.
    Thanks,
    Jay
    null

  • Event Handling in Fullscreen Exclusive Mode???????

    WIndows XP SP2
    ATI 8500 All-In-Wonder
    JDK 1.6
    800x600 32dpi 200 refresh
    1-6 buffer strategy.
    the graphic rendering thread DOESN'T sleep.
    Here's my problem. I have a bad trade off. In fullscreen exclusive mode my animation runs <30 fps and jerks when rendering. i.e. stop and go movement (not flickering/jittering just hesitant motion) when the animation is running. I solved this problem by raising the thread priority of the rendering (7-8). . . this resulted in latency/no activity for my input events both key and mouse. For instance closing the program alt-f4 will arbitrarily fail or be successful when the thread priority is raised above 6.
    How does one accomplish a >30 fps and Instant event handling simultaneously in Fullscreen Exclusive Mode?
    Is there a way to raise thread priority for event handling?
    Ultimately I want to be able to perform my animations and handle key and mouse input events without having a visible 'hiccups' on the screen.
    Much Appreciated!

    If I remember correctly the processor is a 1.4(or)6ghz AMD Duron
    Total = 1048048kb
    Available = 106084kb
    Sys Cache = 211788kb
    PF Usage = 1.01 GB
    I solved some of the problem after posting this thread. . . .
    I inserted a thread.sleep(1) and my alt-f4 operation worked unhindered with the elevated thread priority.
    I haven't tested it with mouse event or any other key event but at the moment it looks I may have solved the problem.
    If so, my next question will be is there a way to reduce the amount of cpu power needed to run the program.
    I'm afraid that the other classes that I'm adding will actually become even more process consuming than the actually rendering thread.
    public class RenderScreen extends Thread
      // Screen Rendering status code
      protected final static int RUNNING = 0,
                                 PAUSED = -1;
      // frames per second and process time counters
      protected long now = 0, fps = 0, fpsCount = 0, cycTime = 0;
      // thread status
      protected int status = 0;
      protected Screen screen;
      public void setStatus(int i){ status = i; };
      public void setTarget(Screen screen){ this.screen=screen; };
      public void run()
        setName("Screen Render");
        screen.createBufferStrategy(1);
        screen.strategy = screen.getBufferStrategy();
        for(;;)
          if(status == RUNNING)
            now = System.currentTimeMillis();
            while(System.currentTimeMillis() <= now+1000)
              // call system processes
              // fps increment / repaint interface
              fpsCount++;
              screen.renderView();
              try { Thread.sleep(1);}catch(InterruptedException ie){ ie.printStackTrace(); }
            fps = fpsCount;
            cycTime = System.currentTimeMillis() - (now + 1000);
            fpsCount=0;
      public RenderScreen(){};
      public RenderScreen(Screen screen){ this.screen=screen; };
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class Screen extends Window
      BufferedImage image = new BufferedImage(800,600,BufferedImage.TYPE_INT_RGB);
      Graphics2D gdd = image.createGraphics();
      MediaTracker tracker = new MediaTracker(this);
      Image bground = getToolkit().getImage("MajorityRule.jpg"),
            bawl = getToolkit().getImage("bawl.gif");
      RenderScreen rScreen = new RenderScreen(this);
      BufferStrategy strategy;
      Graphics g;
      Rectangle rect = new Rectangle(400,0,150,150);
      //Game game = new Game();
      public void renderView()
        g = strategy.getDrawGraphics();
        //--------- Game Procedures [start]
        gdd.drawImage(bground,0,0,this);
        gdd.drawString("fps: ["+rScreen.fps+"] Cycle Time: ["+rScreen.cycTime+"]",0,10);
        //--------- Game Procedures [end]
        //---------test
        gdd.drawImage(bawl,rect.x,rect.y,rect.width,rect.height,this);
        rect.translate(0,1);
        g.drawImage(image,0,0,this);
        //g.dispose();
        strategy.show();
      public Screen(JFrame frame)
        super(frame);
        try
          tracker.addImage(bground,0);
          tracker.addImage(bawl,1);
          tracker.waitForAll();
        catch(InterruptedException ie){ ie.printStackTrace(); }
        setBackground(Color.black);
        setForeground(Color.white);
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MajorityRule extends JFrame
      // Graphic System Handlers
      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice gd = ge.getDefaultScreenDevice();
      GraphicsConfiguration gc = gd.getDefaultConfiguration();
      Screen screen = new Screen(this);
      Paper paper = new Paper();
      public void windowed()
        paper.setSize(getWidth(),getHeight());
        getContentPane().add(paper);
        setResizable(false);
        setVisible(true);
      public void fullscreen()
        DisplayMode dMode = new DisplayMode(800,600,32,200);
        screen.setBounds(0,0,800,600);
        if (gd.isFullScreenSupported()) gd.setFullScreenWindow(screen);
        if (gd.isDisplayChangeSupported()){ gd.setDisplayMode(dMode); };
        screen.setIgnoreRepaint(true);
        screen.setVisible(true);
        screen.rScreen.setPriority(Thread.MAX_PRIORITY);
        screen.rScreen.start();
        screen.requestFocus();
      public MajorityRule(String args[])
        setTitle("Majority Rule [Testing Block]");
        setBounds(0,0,410,360);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        getContentPane().setLayout(null);
        if (args.length > 0 && args[0].equals("-window")) windowed();
        else fullscreen();
      public static void main(String args[])
        new MajorityRule(args);
    };

  • EmailRecieved Event handler for incoming email in Sharepoint 2013

    Hi,
    I am developing custom event handler to enable incoming email for custom document library.  i have couple of questions.
    1. Once i attached the event handler, i could see incoming email settings for the custom document library, but it displays only 2 options as below :
                  1.   Allow this document library to recieve email
                                 Yes       No
                    2. E-mail address
    All other properties are not displaying. Is this normal behaviour on custom event handler for custom document library or any issue anywhere?
    2. So i have given other properties using powershell as below:
    $list = $web.lists["invoice Documents"]
    $list.EmailAlias ="TestDocument"
    $list.EnableAssignToEmail = $true
    $list.rootFolder.Properties["vti_emailusesecurity"] = 1
    $list.rootFolder.Properties["vti_emailsaveattachments"] = 1
    $list.rootFolder.Properties["vti_emailattachmentfolders"] = "root"
    $list.rootFolder.Properties["vti_emailoverwrite"] = 0
    $list.rootFolder.Properties["vti_emailsavemeetings"] = 0
    $list.rootFolder.Properties["vti_emailsaveoriginal"] = 0
    $List.RootFolder.Update();
    $list.Update();
    here i have given vti_emailusesecurity as 1, so it should allow incoming email for the user who has permission for the list.
    But any user from the domain is sending mail to this list, the Emailrecieved event handler is triggered. I am expecting that this event handler should not be triggered and expecting access denied error in the ULS Log. But that is not happening, and emailrecived
    is triggered and email is delivering to this address successfully.
    Can you please anyone help if experience on this?
    Thanks
    Sathya

    http://www.coretekservices.com/2012/01/26/sharepoint-content-organizer-%25e2%2580%2593-emailing-your-drop-off-library-and-getting-it-to-work
    Central Administration > Monitoring > Review Job Definitions (under Timer Jobs) > Content Organizer Processing
    Also check below:
    http://tutorial.programming4.us/windows_server/SharePoint-2010---Content-Organizer-as-a-Document-Routing-Tool.aspx
    If this helped you resolve your issue, please mark it Answered

  • Global event handler for preinitialize

    Is there anyway to add a global event handler on the
    components preinitialize event?
    What I need to do is to be able to enable / disable, and show
    / hide component dynamically based on a access list. My plan was to
    have a global event handler that listens to the preinitialize
    event, at that time, checks if the user has access to the component
    or not. If not, I'll disable / hide the component.
    What I did so far is:
    in my main app.mxml file, I have:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    preinitialize="preinit(event)"
    so the preinit() function is invoked on the app's
    preinitialize event.
    Then I have the preinit() function (see attached code below).
    However, it does work as there is no trace message printed.
    I changed to use KeyBoardEvent.KEY_DOWN and that seems
    working when I press any key.
    I also tried to use the app.stage.addEventListener() but the
    stage object is null in the preinitialize event.
    Thanks in advance for your help.

    Thank you for follow up on my question.
    I do know these two properties. But that does not solve the
    problem. Let me explain it with an example.
    That's say, when the user logs in, I loads the access list.
    Then the app displays a panel with some form entries. If I am able
    to register a global event listener for the component
    initialization events, I can check the permission and optionally
    hide some components. Otherwise, I would need to programmatically
    travels my component tree to evaluate each component individually
    to set there visible/includeInLayout properties, which is error
    prone.
    The problem is that the component is visible to one user but
    would be hidden to another, so it can not be set at the design
    time.
    The approach I am using right now is to extend the default
    components to add an event listener. But I'd like to know if it is
    possible to register a global event listener to be notified when
    any component is created. As my first post says, I tried to use the
    systemManager and listen to the PREINITIALIZE event, but that
    didn't get always get invoked.

Maybe you are looking for

  • Seagate backup desktop disk you inserted was not readable by this computer

    I am running IOS 10.7.5 and have a seagate 4TB Backup Plus Desktop external drive. I have all of our iPhoto library on it. I get the message "The disk you inserted was not readable by this computer". I went to disk utility and the drive shows up but

  • Problem With Tv Shows Menu

    i just recently downloaded the new itunes software. and was susrprised to see that you could now select TV shows to sort out your video library( finaly itunes got the message) and quickyly changed all my collection of TV shows to the right sort. but

  • What is the error in update

    UPDATE Forum SET Postid = 16615, Subject = 'hi jss is not going to hightech', Author = 'vipin', date = '06 November 2005', Reply = 22 where Postid = 16615 error java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE t

  • Compiling packages from command line

    hi...good morning all... I want to compile 5 packages from command prompt.. I have written a batch file like this... d: call sqlplus -s scott/tiger@ora11g @package1.sql call sqlplus -s scott/tiger@ora11g @package2.sql call sqlplus -s scott/tiger@ora1

  • Do we have any BAPI to get the Sales quote or Sales order details

    Hi Experts, Do we have any BAPI to get the sales quote or sales order details from my other SAP system. My requirement is to get the sales quote or sales order details from the other SAP system. Please help. Regards, Chitrasen