Double execution of actionListener method, normal behavior

Hi,
I don't understand this behavior i have a commandButton in my JSP
<h:commandButton value="testActionListener" actionListener="#{LoginBean.actionListener}" immediate="true" />When I click on this button, the associated code (my actionListener method in my bean) is executed two times.
In my opinion if the scope of my bean is "request" the execution would have to be the constructor then my method actionListener.
Why do this method is executed two times after the constructor ? Is it the normal behavior ?
Thanks
Edited by: Antony97 on Dec 13, 2008 8:03 AM

hello
try this link
http://www.javabeat.net/tips/67-how-to-implement-actionlistener-factionlist.html
initally i got the same problem
write seperate bean and actionlistener. as the link suggest your problem is solved

Similar Messages

  • Commandbutton inside popup does not fire action/actionlistener methods

    Hi,
    I am using 11.1.1.4.0
    I have a page and on click of a button on that page, I launch a popup (using showpopupbehaviour, triggertype="click") which has a region (taskflow) inside it. The region is within a af:panelWindow inside the popup. I have also added 2 commandbuttons in the popup. Everything works fine, but the when the popup is visible, and I click the 2 command buttons on the popup, it does not execute the action method (or actionListener) method that I defined for those buttons. Any idea why this must be happening?
    Code for the popup:
    <af:popup id="popup1" contentDelivery="lazyUncached" binding="#{BackingBean.popup}">
    <af:panelWindow modal="true"
    title="#{pageFlowScope.tabContext.outcomeForPopup}"
    id="paWin12"
    helpTopicId="TOPICID_ALL"
    resize="on">
    <af:panelTabbed id="pt123" position="above"
    inlineStyle="width:650px; height:650.0px;">
    <af:showDetailItem id="sdi0"
    text="#{pageFlowScope.tabContext.outcomeForPopup}"
    stretchChildren="first"
    accessKey="0"
    immediate="true">
    <af:region value="#{bindings.r0.regionModel}"
    id="r1"/>
    </af:showDetailItem>
    </af:panelTabbed>
    <af:commandButton text="First"
    action="#{BackingBean.firstClick}"
    actionListener="#{BackingBean.firstClick}"
    id="cb3">
    </af:commandButton>
    <af:commandButton text="Second"
    action="#{BackingBean.secondClick}"
    actionListener="#{BackingBean.secondClick}"
    id="cb4">
    </af:commandButton>
    </af:panelWindow>
    </af:popup>
    In the page definition of the main screen, I have this taskflow added
    <taskFlow id="r0" Refresh="ifNeeded" activation="deferred"
    xmlns="http://xmlns.oracle.com/adf/controller/binding"
    taskFlowId="#{pageFlowScope.tabContext.taskFlowIdForPopup}">
    <parameters>
    <parameter id="outcome"
    value="#{pageFlowScope.tabContext.outcomeForPopup}"
    xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
    <parameter id="tabContext" value="#{pageFlowScope.tabContext}"
    xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
    </parameters>
    </taskFlow>
    Thanks
    Vishal

    Hi friend ,
    1,Inside the pop up u give two command buttons and double click the one button and it asking for create one bean.
    2.U create the bean and inside u give coding like
    public class popvisible
    public popvisible()
    public String page1naviagetion()
    // Add event code here...
    return "popTouser";(This is is Control flow case name it will go to another JSPX page.)
    public String page2navigation()
    // Add event code here...
    return null;
    }

  • I have a Panasonic FZ38 HD camera. I can load and view my hd movies onto iMovie with no problems via my camera or a card reader.  When I try to copy my hd videos from my old Windows pc to my new iMac, the picture speed has doubled but the sound is normal.

    I have a Panasonic DMC-FZ38 HD camera and have lots of hd movie clips stored on my old Windows Pc using Photofun software supplied by Panasonic, which I want to transfer to my new Imac computer.   I am able to copy my most recent movies that are still on the memory card from my camera onto Imovie and view them with no problems at all.  When it comes to copying my old existing hd movies stored on my Windows Pc (and which are no longer stored on a memory card), I discover that when I view them on the Imovie, the speed has doubled but the sound is normal.   In order to transfer my old movies I have copied them back  onto a memory card (SDHC - the same card as previously used) and then put the card back into my camera and then copied them onto my Imac via the camera USB.   I have also used a card reader but get the same result.     If I view the same movie through my camera, or look at it on my old pc, it plays at normal speed.    Does anyone have any ideas as to why this is happening please?

    have you read and watch the Tutorials..? :
    http://www.apple.com/ilife/tutorials/#imovie
    iM is a bit.. iffy, when it comes to the definition, what a 'camera' is. historically, only tape based machines were a movie-camera. nowadays still-cams allow movin' images too..
    but, as mentioned above: the intended workflow is: material from photo cameras (even when they move) => import via iPhoto; material from video cameras (even when they don't move.. ) => iMovie
    when the import is done, you'll notice in all iLife apps the 'media browser' - in iM09, on the very right, the icon with a camera on.. click it, presto, all (incl. your 'videos') your iPhoto Library at hand for usage in iMovie.
    watch this:
    http://www.apple.com/findouthow/movies/imovie08.html#tutorial=otherimport
    (about from midths of tutorial...)

  • Is that the normal behavior of ImageReader?

    When javax.imageio.ImageReader reads frames of an optimized animated gif (where only the changes in each frame are saved), it will only return a small portion of the image when it falls on an optimized frame. So let's say an animation has the size 50x50, ImageReader.read(...) will return BufferedImages of varying lengths due to the optimization. Is that the normal behavior, or should it build up the complete image back itself? If I should be responsible to reconstitute the image, then anyone knows how I should go about it?
    Thanks in advance for your input!
    Dalzhim

    Probably. The GIF will only basically have partial frames after the first, or where the entire frame changes. That would suggesst that the class can't really handle that type of GIF in a way that it would recreate each frame based on the previous one(s). I'm not sure that it's a bug, though. It could be intentional, as it just gives the images that are there, and nothing more or less, letting the user deal with them. I would imagine you could overlay them to get the right effect?

  • Normal behavior in Start Up Manager?

    I have several volumes in use at any time, so I boot into the Start Up Manager (option key) quite a bit. In the past, this screen displayed the names and corresponding icons of the available volumes (e.g., Macintosh HD, Media, whatever), but in 10.6.x, all of the available 10.6 volumes are displayed with the name, 'EFI Boot' (the icons for these volumes display as expected), and not with the names associated with those volumes.
    Is this normal behavior now or do I have an issue that needs to addresed?

    Yes. As (I'm discovering) has been noted elsewhere, there is some sort of battle going on btwn DW 4.2 and DU on the 10.6 Install disc.
    After DU, running diskutil list...
    Last login: Fri Sep 11 14:41:14 on console
    whatever:~ whatever$ diskutil list
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUIDpartitionscheme *320.1 GB disk0
    1: EFI 209.7 MB disk0s1
    2: Apple_HFS Macintosh HD 308.3 GB disk0s2
    3: Apple_HFS Maintenance Only 11.3 GB disk0s3
    whatever:~ whatever$
    After running DW, I've been getting a message referring to 'critical values' having been changed, the boot volumes are renamed, and there are 79 files left out of order--this is on two brand new MBPs. Interestingly, all clones repair to 0 files out of order.

  • What should be the normal behavior when calling a retired/stopped process?

    Dear all,
    I thought that when one of my asynchronous BPEL process would call another asynchronous BPEL process that is retired or stopped(with no other version number active), I would receive any kind of error. So I tried it, and instead of receiving an error, the first BPEL process sent his message and received the ack without any errors (that is in both cases, retired or stopped). So I checked if the message was put in the thread queue or any other kind of queue and no it wasn't. I tried to reactivate the second process, and nothing happened. So I guess the message had been lost. Is this the normal behavior??
    Since we are implementing asynchronous processes to do a "fire and forget" type of system, we would have liked to receive some kind of error so we know that no instance had been instanciated and that the message had not really been delivered?
    Can anyone tell me where I'm wrong. Is there a chapter talking about that in any document. If anyone has read about that I'd like to know where so I can understand the way it works!
    Thank you!

    Thanks for your prompt reply,
    I'm sorry but I'm not sure I understand the onError callback thing,
    If we consider my called asynchronous process was a one-way process (no callbacks),
    Correct me if I'm wrong but:
    -This means I would have to define a callback in the called process (that onError callback).
    -Then, I gotta put a receive or a pick activity, which means I need to wait for an error answer, which is not wanted.
    -And, would a retired or stopped process really answer me and throw me an error?!?! I'm not sure since its stopped... So i would probably wait forever I guess.
    I'm just trying to find a way to make sure the message has been taken in charge by the next process and if not, to be alerted!
    Thanks for helping a beginner like me!
    Btw I've read that post:
    Re: How to throw a Fault from an asynchronous process to another process
    It helps understanding the fault handling in asynch processes, but my problem is more about the fact that my async process is stopped/retired!

  • Intercept all actionListener methods

    Hi every body,
    Is there a way to intercept actionListener methods ?
    ex:
    I have
    <h:commandLink actionListener="#{mb.actionListener}" value="link" />
    In my faces-config.xml I have :
    <application>
    <action-listener>ca.test.util.security.SecurityActionListner</action-listener>
    </application>
    The method mb.actionListener is allways excuted before the SecurityActionListner.processAction method, thus I can't intercept it.
    Edited by: Faissal on Jun 20, 2009 1:59 PM

    Thank you all for your answers :)
    My action listener is declared as bellow :
    public String actionToDo(){
      LoggingUtils.logAndReturnMessage("ManagedBean.actionToDo",LoggingUtils.INFO);
    public void actionTest(ActionEvent e){
              LoggingUtils.logAndReturnMessage("ManagedBean.actionTest",LoggingUtils.INFO);
         }And the SecurityActionListener :
    public class SecurityActionListner implements ActionListener{
          private ActionListener parent;
          public SecurityActionListner(ActionListener parent) {
                  this.parent=parent;
         public void processAction(ActionEvent event) throws AbortProcessingException {
              // I would like to filter the access to the action listeners or value change events here
              LoggingUtils.logAndReturnMessage("SecurityActionListner.SecurityActionListner",LoggingUtils.INFO);
              parent.processAction(event);
    }But the problem here is that actionToMe(ActionEvent e) is allways executed before SecurityActionListner.processAction(ActionEvent event) . The web server console shows me the following text :
    Whene I execut ManagedBean.actionTest I have :
    INFO : ManagedBean.actionTest
    INFO : SecurityActionListner.SecurityActionListnerAs you can see it's impossible to intercept and for exemple deny access to ManagedBean.actionTest because it's executed befor the action listener/
    And whene I execute ManagedBean.actionToDo I have :
    INFO : SecurityActionListner.SecurityActionListner
    INFO : ManagedBean.actionToDoThanks
    Edited by: Faissal on Jun 25, 2009 4:10 AM

  • Method double execution

    im trying to run my method.it works perfectly, but runs 2wice as much as i want it to. this cannot be fixed by didviding the number by two. I need one to execute the Method, maby im not calling it correctly, and one to execute in the loop
    Here is my execution file:
    import java.util.*;
    import java.lang.*;
    public class methodExecuter{
      public static void main (String[] args){
        Scanner sc = new Scanner (System.in);
        //ALARM
       System.out.println ("Enter number:");
       int num=sc.nextInt();
       *System.out.print (Alarm.Alarmed(num));* //PROBLEM LINE
    }And here is my method file:
    import java.awt.*;
    import java.lang.*;
    public class Alarm
      //class constructor - no info required
      public Alarm ()
      public static String Alarmed (int repeat){ 
       String alarm= "Alarm";
        if (repeat<1) {
          System.out.println ("Sorry, number has to be greater than one!");
        else {
          for (int i=0;i<=repeat;i++) {
    *System.out.println (alarm);* //PROBLEM LINE
        return alarm;
    }

    1) don't call Alarm.alarmed within a System.out.println(..). Rather just call the method itself.
    2) within the alarmed method, use a for loop, not a while loop since you know in advance how many times it should be repeated.

  • SSRS Execution Service Render Method stopped working

    Hello SSRS Profis!
    I'm having the following Problem:
    I was trying to integrate SSRS in my Company-Software, and until today it went quite good:
    Its an ASPMVC 5 project with WCF-Services, and in these i had methods to render reports with the help of the ReportExecution - Webservice (2005), the Version of the MSSQL Server we use is 2008R2, reports use stored procedures as data sets.
    Everything worked fine, i could render all my reports in the services, gave the result back to the Frontendprojects to present it there, it worked fast and properly.
    Until today: For some reason, the call of the ReportExection.Render() - Method gives no more results back.
    Debugging shows me that it works approx. the same time as it did before for every report, but the result now is only "null" for every report i integrated until now:
    Here is the code I use to execute the service (for network credentials i use a user with administrator privilegue who can access all the reports (tested in private session), Parameter constructio also should work properly because it did before, same
    for the Report path...
    Any Ideas would be helpful!
    private byte[] getPDFFromReport(string ReportPath, Dictionary<string, string> parameterDicitionary)
    ReportExecutionService rs = new ReportExecutionService();
    // private method to set a user with enough permissions
    rs.Credentials = SetServiceAccount();
    // Render arguments
    byte[] result = null;
    string reportPath = ReportPath;
    string format = "PDF";
    string historyID = null;
    string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
    // Prepare report parameter.// mapping Parameters, gives back ReportExecution.ParamaterValue Array, still works as it should
    ParameterValue[] parameters = SetReportParameters(reportPath, parameterDicitionary); DataSourceCredentials[] credentials = null;
    string showHideToggle = null;
    string encoding;
    string mimeType;
    string extension;
    Warning[] warnings = null;
    ParameterValue[] reportHistoryParameters = null;
    string[] streamIDs = null;
    ExecutionInfo execInfo = new ExecutionInfo();
    ExecutionHeader execHeader = new ExecutionHeader();
    rs.ExecutionHeaderValue = execHeader;
    execInfo = rs.LoadReport(reportPath, historyID);
    rs.SetExecutionParameters(parameters, "de-de");
    // rs.Timeout = 300000;
    String SessionId = rs.ExecutionHeaderValue.ExecutionID;
    Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID);
    try
    result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
    execInfo = rs.GetExecutionInfo();
    Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime);
    catch (SoapException e)
    Console.WriteLine(e.Detail.OuterXml);
    // Write the contents of the report to an MHTML file.
    return result;
    Edit:
    I tested the methods with the same user in an WindowsForms Project and got a result. In a former Version, it also still works. I changed nothing since the last deploy in this methods, so can't imagine why it suddenly stopped working....

    Found the solution!
    After checking team-foundation-changelogs of the last checkins, it turned out that somehow automatically some value in the reference.cs of the reportexecution - webservice was changed from:
            [return: System.Xml.Serialization.XmlElementAttribute("Result", DataType="base64Binary")]
    to
            [return: System.Xml.Serialization.XmlElementAttribute("Value", DataType="base64Binary")]
    After deleting and readding the webreference to the Project, it worked again.
    The next Thing to Research for me is how it can be, that this value automatically changes. Possibly because of different Versions of VS in the dev-Team.. (Ultimate and premium) In any case, this issue is solved, thank you for reading :)

  • Double-click to create method/attribute in EHP2 Netweaver 7.0 does not work

    Hi,
    this makes me wonder:
    I'm used to create new attributes or methods by simply double-clicking the new name and the system will ask me to create. Now I am new in EHP2 and for methods it just says 'wrong cursor position or object not in navigation', for attributes system just does not show any reaction.
    Please help me as it is really annoying always to create things from object tree or class header.
    What is it I do not see?
    Thanks so much.
    Clemens

    Hi,
    sorry I thought it was clear: I try in the new ABAP front end editor - accessed through SE80, SE24, SE38 and anay transaction that allows you to edit code (except  lousy things like the enhancement spot implementation code window).
    An it is still the same: In a report, I can write perform xyz and double-click will asjk me to create a form. Just in oo context, attributes and methods should be the same - as it was since ECC600 or even before on 46C. Except our current system I don't know anyone working on EHP2 for Netweaver 7.
    EHP2 just another undeclared untested Beta-Version?
    I can't believe.
    Regards,
    Clemens

  • ADF BC and direct database call from ActionListener Method

    Hi
    I have an ADF BC application which generates a simple form . In the submit button I am calling a Java method which makes a direct database connection. The application hangs when the method does the executeUpdate() method
    public void onSubmit(ActionEvent actionEvent) {
    DBSequence prdSequenct=((DBSequence) resolveExpression("#{bindings.ProductId.inputValue}"));
              int productId = new Integer(prdSequenct.toString()).intValue();
              String productName = (String) resolveExpression("#{bindings.ProductName.inputValue}");
    update(productName,productId);
    public void update(String productName,int productId) {
    String str ="update products set product_name=? where product_id =?";
    Connection con=null;
    PreparedStatement pstmt= null;
    try {
    con = new DatabaseConnection().getConnection();
    pstmt= con.prepareStatement(str);
    pstmt.setString(1, productName)
    pstmt.setInt(2, productId)
    pstmt.executeUpdate();
    } catch (SQLException e) {
    e.printStackTrace();
    }finally {
    try
    pstmt.close();
    con.close();
    }catch(SQLException sqle) {
    sqle.printStackTrace();
    when I submit the form the update() method hangs at executeUpdate();
    If I run the update() method from a standalone java its works fine.Can anybody tell what could be the issue ?
    Thanks
    Suneesh
    Edited by: Suneesh Raman on Aug 18, 2010 10:14 AM

    I am using jDev Studio Edition Version 11.1.1.2.0 . Infact I need to call a PL/SQL api from the onSubmit method which I set in the action listener of submit button of the form.
    My getConnection method is :
         public Connection getConnection() throws SQLException {
              DriverManager.registerDriver(new OracleDriver());
              Connection con =
              DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","rme_pbkr", "rme_pbkr");
              OracleDataSource ods = new OracleDataSource();
              ods.setUser("rme_pbkr");
              ods.setPassword("rme_pbkr");
              ods.setURL("jdbc:oracle:thin:@localhost:1521:XE");
    System.out.println("::: con = :::"+con);
              return ods.getConnection();
    Does that mean we cannot make a db connection from the actionlistener implementation method ?
    How to put the method in AM implementation class ? Just write a public void method there and call from onSubmit button actionlistener through some binding ?
    Thanks
    Suneesh

  • Order of execution of named method user properties and server script

    Dear All,
    If for a Custom method on an applet, we have scripts in WebApplet_preinvokemethod and WebApplet_invokemethod and also for the same Custom method we have applet Named Method user properties and BC Named Method user properties, what will be the order of execution of these scripts and Named Method user properties??

    The Private Event Submission sample portlet shows how to achieve this. It is part of the PDK download.
    Peter

  • How to stop an execution from a method and thread?

    1,
    public void method(){
    if( something is true)
    //I want to stop this method
    //or if something is false, go on
    blablablablabla
    }Does any one know how to solve the above??
    2,
    Thread t = new Thread(){
    public void run(){
    if( something is true)
    //I want to stop and kill this Thread
    //or if something is false, go on
    blablablablabla
    }Again, how do I solve the above??
    I know this is very simple, but I just hit a wall when I encounter this on making a program for my project.
    please help
    thanks alot

    warnerja, for the method, I have tried "return" but
    it does not work... will it work on the run method of
    thread object??
    Secondly, doesn't "break" keyword only stops the
    execution of a loop/condition, but not the method's
    scope??yes. break breaks the loop. I thought your method doesnt have any other code except the condition.
    use return with thread.

  • Why RichCommandButton doesn't invoke the actionListener method?

    I have a dynamically drop down list, it is refreshed when user changes something on the UI.
    And I add a “RichCommandButton” button and set its ActionListener is a method in the backend bean (for example, #{ctrlBean.onClick} ), the bean’s scope is Request.
    In the backend bean method, I want to do the commit.
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    oracle.binding.OperationBinding operationBinding =
    bindings.getOperationBinding("Commit");
    operationBinding.execute();
    When I click the button on UI, the UI refreshes once and the dynamical entity type dropdown list becomes empty and the debugger doesn’t come into the breakpoint in the method.
    Can anybody explain the process when clicking the button?
    I don't know why the UI refreshes, but don't invoke my method.
    Thanks

    K. Konuri
    An Applet must implement at least one
    of the following methods: init, start, or paint. Unlike Java applications, applets do not need to implement a
    main method
    The init() method, which works much like a constructor, handles whatever
    initialization your applet requires. The browser or applet viewer automatically
    calls it to perform applet initialization each time the applet is loaded.
    Deepak

  • How can i calculate execution time for methods?

    I'm making a project that i want to calculate execution time for a
    method in "miliseconds" or "microseconds".You see,I have a sort algorithm and i want to calculate execution time of this algorithm.How can i do?
    Thanks...

    Just remembered.
    The answer you get isn't trustworthy below a hundred millis, so you may need to sort a hundred or a thousand times to get a reasonable elapsed time. You also need to run the test five or ten times and take an average. In Windows you should fire up the Task Manager and be sure that your other CPU usage is as near to zero as you can get.

Maybe you are looking for

  • MSI GeForce 8800 Ultra OC Lock / Freeze ups

    Hi, this seems to be a general problem not just with MSI, I'm reading exactly the same problems being experienced by other 'Ultra' users. After 20 or so mins of play (mainly bf2 / COH / Far Cry for me) the card/display driver crashes, the screen flic

  • My iPhone wont connect to either iTunes or my computer

    Hi my name is Connor recently my iPhone 4 has stopped connecting to my laptop or iTunes! i have tried about 4 different usb leads to see if that was the issue but all of them dont connect it. It makes the noise that it makes if it connects but it has

  • Generator +Alpha not rendering w/alpha???

    Is it me or what? A simple 1.2 second flash transition using: 1. one instance of lens flare from left to right 2. one instance of lens flare from right to left when the two intesect at center of canvas, I blast the intensity to wipe the screen as a t

  • I see the license agreement as HTML source code

    Hello, I downloaded a trial version of Adobe Acrobat 9.0, but after I had installed it and start it, it wants me to agree on the license agreement. but my problem is that I can't click on Agree nor Disagree because I see only HTML source code see the

  • Ibook G4 Keyboard Arrow Key

    hi, maybe sombody has a helpful hint here? I have an iBook G4, I've only had it since May. maybe April of 2005. just one day ago, the left arrow key (also marked "home") stopped responding. I can physically press the key just as always. Feels normal.