Operation Binding is executed twice

Dear All,
I created an Action Binding in my pageDef file. This will call the web service interface.
In the action listener method of my button, I am invoking this action binding using this code
below:
    OperationBinding method =
      getBindings().getOperationBinding("MyWebService");
    method.execute();All is well but I notice that when I looked at my HTTP Analyzer, I notice that my web service is called twice.
Has anybody encountered this?
I read about the blog by Shay about Web Service being called twice, https://blogs.oracle.com/shay/entry/web_service_across_pages_calle
but I have a different use case than him as I have only one page.
Anyone has hints?
My problem causes double posting of transaction which is unnecessary.
-JDEV 11G PS5
-Web Service Business Services
Edited by: Neliel on Nov 15, 2012 10:24 PM

Have you tried to delay the call to the web service?
Check https://blogs.oracle.com/shay/entry/delay_method_execution_when_us
Timo

Similar Messages

  • Feedback requested: in backing bean, use AM svc method or operation binding

    Hello all,
    I'm posting this here to solicit feedback from both Oracle and from the community at large. The basic question is around what is the best/better practice for calling Application Module service methods from a backing bean. One choice is to call the service method directly on the application module; the other is to put an operation binding in the page definition and to execute that binding. The basic code for the two methods:
    ((MyAppModule) getBindings().getDataControl.getApplicationModule()).serviceMethod();or
    getBindings().getOperationBinding("serviceMethod").execute();My question comes up specifically because of differences in how the default error handling works. For testing, we created a simple AM with a single service method that throws a JboException (a kind of RuntimeException). Then, we created a simple ADF Faces page with an af:messages (to see how error handling works) and four af:commandButtons. The four command buttons are as follows (the code is in the backing bean for each of them):
    1). partialSubmit=false, calls application module service method directly
    2). partialSubmit=false, executes service method via operationBinding
    3). partialSubmit=true, calls application module service method directly
    4). partialSubmit=true, executes service method via operationBinding
    None of the backing bean methods catch any exceptions. Note that #2 and #4 could be bound directly to the methodBinding in the pagedef, but we did it via code in the backing bean to more accurately mimic some of the code in our application; in any case, the results were the same using either method for #2 and #4.
    The results when clicking each button:
    1). ugly stack trace in the browser window (yuck!)
    2). the af:messages component displays the JboException (nice)
    3). No stack trace, no error message (even worse than #1, user thinks "success," even though exception occurred)
    4). the af:messages component displays the JboException (nice)
    This leads me to think that perhaps calling via the binding container is the preferred method because the default error handling gives acceptable behaviour, whereas using the AM directly gives unacceptable behaviour.
    Another "benefit" of calling through the binding container is that the technology in the model layer could be changed without having to change the view layer. I say "benefit" in quotes because I personally believe that one should write applications to take full advantage of the technology they choose, not try to strive for technology/database independence (no flames on this one please - that's not the main point here ;).
    Having made the preliminary conclusion that the binding container is the preferred way to go for service methods - that could then ostensibly be extended to view objects as well. Should the view layer use iteratorBindings instead of dealing with view objects directly as well? This is a bit more shaky ground because there are some points in the view/controller layer (namely managed beans not associated with any page) where there is no binding container available. However, in backing beans, for re-executing queries we could make the "best practices" statement to always use iteratorBindings instead of accessing the AM/VO. I just completed a test comparing view object usage vs iterator binding usage (vo.executeQuery() vs myIter.executeQuery()) with similar results to the AM testing - the binding container route gives acceptable error handling, whereas the VO route forces me to implement my own error/exception trapping and message display.
    I am aware of one drawback to using the binding container instead of the AM directly - that is that each page that needs the service method must have something in it's pageDef for that method. Originally, we had some code in a superclass of some backing beans that called the AM directly, and we didn't need to touch the pageDefs of approximately 20 JSF pages - when changing to use the operation binding - we had to add it to a lot of page defs.
    I'm very interested in feedback from the community at large on my conclusions. If the discussion gets to be too big/complicated for here, we can change venues to perhaps the oracle wiki or another forum. I did do a quick review of SRDemo ADFBC and noted that all of the service method calls are done through operation bindings - I never noticed that before! Most of the discussion we see in the forums shows people calling them directly, which is why I thought it important to post here.
    Best regards,
    John

    What we did in our project was that we create a "Headless" pagedefinition, (that was how it was described in SRDemo documentation or in JDeveloper help, its on the latter part about Security).
    You have to create that pagedef manually. and it only has an
    <page id="yourPageDef_Id" path="..."> entry in your Databindings and no
    <page path=".../yourPageDef_id" usageId=".../???.jsp">And then in your faces_config and your managed bean name is backingSystemStateBean and is located at path.to.bean.SystemState add a Session scope bean entry like this:
      <managed-bean>
        <managed-bean-name>backingSystemStateBean</managed-bean-name>
        <managed-bean-class>path.to.bean.SystemState</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
          <property-name>bindings</property-name>
          <value>#{data.yourPageDef_Id}</value>
        </managed-property>

  • Difference between operation binding as a button click and in a bean.

    Hi All
    Jdev version is 11.1.1.6.0
    I have a programmatic VO with a method which populates it(method in VOImpl).
    When I add that method to Page with VO as ADF Table, on clicking of that button, the table refreshes.
    But when I execute this method as operation binding in a java bean the table is not refreshed.
    Am I missing something.
    Thanks

    this depends. If you click on the button you submit the page and the components (your table) refreshes. If you call the method from a bean it depends on wher you call the method.
    You can add a ppr to the table component to ask it to refresh.
    UIComponent table = ....
    AdfFacesContext.getCurrentInstance().addPartialTarget(table);where you have to get the table component to refresh.
    Timo

  • Data Federator:  Insufficient memory : Operator 'HashJoin' cannot execute

    Hi,
    I'm using: SAP BusinessObjects Data Federator Designer XI 3.0 Service Pack 3 - 12.3.0.0 (Build 1011241842)
    I have a virtual view on top of sql server 2007 and teradata.  I am using a view on sql server 2007 that joins against several tables and querying a single table from Teradata.
    When I try to query the view I get the error:  [Data Federator Driver] [Server] Insufficient memory : Operator 'HashJoin' cannot execute because it cannot allocate the minimal number of memory pages. Please contact the system administrator to change system parameter settings. (0)
    This happens when I try to query the view from data federator or from an odbc connection.
    I tried playing with the configuration settings for core.queryEngine.hash.maxPartitions  and
    core.queryEngine.hashJoin.nbPartitions  and nothing seemed to work in terms of changing/increasing the numbers.  The help guide also gave no help:  http://help.sap.com/businessobject/product_guides/boexi3SP3/en/xi3_sp3_df_userguide_en.pdf
    I was using a very similiar query against a materialized view on Oracle and Teradata before and that worked.  But I'd prefer not to have to materialize the view in Sql Server.
    Any thoughts as to how this can be fixed?
    Thanks,
    Kerby

    <rant>The strange thing with this forum is no people, really no people, ever do anything to resolve their own problems, even though this forum has a search function, and sites with FAQs and assistance are floating around over the Internet. Why is a mystery, as nobody uses them, and most DBAs only know how to hit copy-and paste, to add to the clutter on OTN again.</rant>
    The usual steps to troubleshoot an ora-1031 apply.
    This means
    - verify whether the local administrator is in the ora_dba group and sqlnet.authentication_services in sqlnet.ora has been set to (NTS)
    - in absence of these, there should a password file be present in %ORACLE_HOME%\database, named pw%SID%.ora
    These belong to the common documented requirements, and these requirements shouldn't be repeated everywhere.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: Those who do read documentation.

  • After Update Trigger executes twice when single row is uptd thro proc

    We have the below trigger in our db. When a single record is updated using a procedure the trigger is executed twice and it inserts two records in other table.
    But when i issue an update statement using any sql client tool it is executing only once and inserts only one record in other table.
    Can any one please help me to find the reason?
    Trigger:*
    create or replace TRIGGER CX_HEADER_ESCL_T1 AFTER UPDATE OF STATUS ON CX_HEADER
    FOR EACH ROW
    DECLARE
    "b1-CTRIYJ" boolean := FALSE;
    BEGIN
    IF UPDATING('STATUS') AND(:NEW.status = 'SUCCESS') THEN
    "b1-CTRIYJ" := TRUE;
    END IF;
    IF "b1-CTRIYJ" = TRUE THEN
    INSERT
    INTO siebel.s_escl_req(req_id, created, bt_row_id, rule_id, tbl_name, created_by, group_id)
    VALUES('11111111', CURRENT_DATE, :NEW.row_id, '1-CTRIYJ', 'CX_HEADER', :NEW.last_upd_by, '1-2CU3');
    "b1-CTRIYJ" := FALSE;
    END IF;
    END;
    Procedure:
    CREATE OR REPLACE
    PROCEDURE CLOSE_BATCH
    (ChildRecordCount IN NUMBER, HeaderId IN VARCHAR2, CompletionStatus OUT VARCHAR2) AS
    CafeChildCount NUMBER;
    BEGIN
    select count(*) into CafeChildCount from SIEBEL.CX_CHILD where HEADER_ID=HeaderId;
    IF ChildRecordCount = CafeChildCount THEN
    update SIEBEL.CX_HEADER set STATUS ='SUCCESS', MODIFICATION_NUM = MODIFICATION_NUM+1 where HEADER_ID=HeaderId;
    CompletionStatus := 'SUCCESS';
    ELSE
    update SIEBEL.CX_CHILD set STATUS='FAILED' where HEADER_ID=HeaderId;
    update SIEBEL.CX_HEADER set STATUS='FAILED' where HEADER_ID=HeaderId;
    CompletionStatus := 'FAILED';
    END IF;
    commit;
    /*CompletionStatus := 'SUCCESS';*/
    EXCEPTION
    WHEN OTHERS THEN
    CompletionStatus := SQLCODE;
    rollback;
    END;

    Your problem seems not be related to the trigger restart issue I have already mentioned because you are using a AFTER UPDATE trigger and not a BEFORE UPDATE trigger:
    >
    BEFORE Triggers Fired Multiple Times
    If an UPDATE or DELETE statement detects a conflict with a concurrent UPDATE, then Oracle Database performs a transparent ROLLBACK to SAVEPOINT and restarts the update. This can occur many times before the statement completes successfully. Each time the statement is restarted, the BEFORE statement trigger is fired again. The rollback to savepoint does not undo changes to any package variables referenced in the trigger. Your package should include a counter variable to detect this situation.
    >
    If you are sure that you update a single row and that your trigger fires twice and if you can easiily reproduce the issue, I recommend that you contact Oracle Support and create a Service Request for your issue that could be an Oracle bug.

  • WPF Animation execute twice

    Hi All,
    I faced an issue regarding the Animation execute twice, please check the code:
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListView.Triggers>
    <EventTrigger RoutedEvent="ListView.MouseEnter">
    <BeginStoryboard>
    <Storyboard>
    <ThicknessAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Margin)"
    From="-100,0,0,0" To="0,0,0,0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </ListView.Triggers>
    </ListView>
    <StackPanel x:Name="spAll" Grid.Column="0" Width="100" Margin="-100,0,0,0" Orientation="Horizontal">
    <ListView x:Name="Handled">
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    </ListView>
    <ListView x:Name="UnHandled">
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    </ListView>
    <StackPanel.Triggers>
    <EventTrigger RoutedEvent="StackPanel.MouseLeave">
    <BeginStoryboard>
    <Storyboard>
    <ThicknessAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Margin)"
    From="0,0,0,0" To="-100,0,0,0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </StackPanel.Triggers>
    </StackPanel>
    </Grid>
    Here is the screenshot:
    When the mouse leave the "spAll" StackPanel. It fired the Mouse Enter event for the ListView. How to avoid this issue? 
    Thanks a lot!
    The future belongs to those who believe in the beauty of their dreams.

    You put your other two listviews in the same column of the grid.
    Since they're defined later, they will be above the first listview... and cause your problem.
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListView.Triggers>
    <EventTrigger RoutedEvent="ListView.MouseEnter">
    <BeginStoryboard>
    <Storyboard>
    <DoubleAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Width)"
    From="0" To="120"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    <EventTrigger RoutedEvent="ListView.MouseLeave">
    <BeginStoryboard>
    <Storyboard>
    <DoubleAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Width)"
    From="120" To="0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </ListView.Triggers>
    </ListView>
    <StackPanel x:Name="spAll" Grid.Column="1" Width="0" Orientation="Horizontal">
    <ListView x:Name="Handled">
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    </ListView>
    <ListView x:Name="UnHandled" Grid.Column="2">
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    </ListView>
    </StackPanel>
    </Grid>
    The above puts your listviews in different columns, although I'm not 100% sure that's what you wanted to happen.
    You would also have to animate the first listview if you want that to disappear.
    There's a potential problem there since as you do that your mouse will leave it.
    I guess you're probably just kind of playing around learning stuff here though.
     PS
    I based this on your first, now deleted, thread.
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • Operator binding does not exist for ora:contains

    Hi all,
    When I try to use the ora:contains operator in any query, for example:
    select id from publi where
    existsNode(publi, '/PUBLI[ora:contains(TITULO,"informes")>0]',
    'xmlns:ora="http://xmlns.oracle.com/xdb"') = 1;
    then, the system gives me the following error:
    ERROR at line 2:
    ORA-29900: operator binding does not exist
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'EXISTSNODE'
    Could it be a XML database (xdb) configuration problem?
    Thank you very much in advance.

    Excuse me, please, for this late answer. I had problems with otn username/password.
    The database version is 9.2.0.2 running in Tru64 Unix 5.1a.

  • Why the code in a user exit is executed twice?

    Hi all,
    I've got a development in a user exit EXIT_SAPMP56T_001.
    This user exit allows us to control the travel expenses.
    When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press the edit button to add new expenses.
    We want to control this and we use this user exit for that purpose.
    When the user selects a row and presses the edit button, the user exit is triggered. We can check the values of the table and see which row is selected. But this exit is executed twice. The first time the table doesn't have any changes on it, the second time it has marked the selected row.
    Why is this happening? Why is this exit executed twice? And how can I control that the table is properlly updated?
    Thank you.

    Hi,
    I think this user exist in getting triggered both in the PAI and PBO of that screen.
    For avoiding this use the flag.
    If flag is initial then only your code needs to trigger.
    if flag is initial.
    flag = 'X'.
    then your code.
    endif.
    So when it again comes into the PBO it will check the flag and the same code will not be triggered for the second time.
    With Regards,
    Sumodh.P

  • Why is the last script executed twice?

    Here is my problem. I have two files, file1.sql and file2.sql that are called in a third file test.sql. The output from test.sql show that file2.sql was called twice
    --file1.sql
    select 'file1' as str from dual;
    --file2.sql
    select 'file2' as str from dual;
    --test.sql
    @file1.sql
    @file2.sql
    The output shows:
    STR
    file1
    STR
    file2
    STR
    file2
    Why is the last file execute twice. If I change the order of files in test.sql, then file1 is displayed twice

    I found my problem. In test.sql I had '/' in the last line
    --test.sql
    @file1.sql
    @file2.sql
    /

  • Operation binding & webservices

    Hello All,
    What I am trying to do is consume a webservice inside my application module-the proxy client is already created and tested- then use this function through operation binding on my page.
    the code proceeds as :
    1) invoke the operation binding
    2)test is there are errors
    3 get the result and process it
    it's working fine ,but there was this strange case when we were trying to modify the code to handle exceptions better,
    here is where things got weird:
    1)invoke the webservice (first time there is no errors).
    2)shut down the webservice server to invoke an error.
    3)invoke the webservice again
    when testing the code we found that the operation still returns a value -after further inspection it was the last successful result-.
    is this the correct behavior ?
    I am using ADF 11g ,jdeveloper 11.1.1.5.

    I did debug the code and made sure that the call is made and logged the error resulting from the call
    Caused by: java.io.FileNotFoundException: Response: '404: Not Found' for url: '<the url for the web service>'
         at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:487)
         at weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:37)
         at java.net.URL.openStream(URL.java:1010)
         at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:842)
         at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:289)
         at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:138)as for reading the data, I read it directly from the operation binding using the getResult() method

  • Operation Binding

    Hi,
    I have an app module method exposed in the client interface. Also I have few other methods in ViewRowImpl exposed in the client interface. I use the ViewRowImpl methods to control UI behavior (Enable/Disable components)
    I have created bindings for app module methods as well as for ViewRowImpl and call these as operation bindings in my backing bean.
    The app module method is called upon submit button and the respective ViewRowImpl will be called automatically in the render response to get whether the UI component is enabled or disabled.
    The problem is when an error received through app module operation binding, all other operation bindings also return null.
    Any solution?

    Hi,
    Go to the bindings tab of your page, and check to see you have added your exposed methods under bindings, if not present add the methods under bindings
    -Prasad

  • When I schedule a Job, the job is executed twice.

    Post Author: sachinddalal
    CA Forum: Data Integration
    Hello,
    I am using Data Integrator Ver 11.0.2.22. I have scheduled the job through Admin Console. When the job is executed it seems that the job is executed twice.
    On the Status tab onDI Administrator, it shows that both the jobs started at same time. The end time of bot the job is different.
    Any one have any idea how this happens?
    Also any way to ensure that the job are not executed twice.
    Thanks,
    Regards
    Sachin Dalal

    Post Author: bhofmans
    CA Forum: Data Integration
    If you get this issue for a scheduled job only, I might be that the schedule is created twice in the OS scheduler. You could check the windows task scheduler (or cron on UNIX) to check for duplicate schedules.
    If you see this issue also for jobs you execute manually (via webadmin or Designer), you can have this kind of problems if the same jobserver is registered multiple times in a repository. You can check the AL_MACHINE_INFO in your repository. It should have one line for each jobserver and one line for each administrator the repo is connected too. I suspect you have some duplicates there (you can just remove them - this table gets populated when adding a repo in the web admin and when adding a repo to a jobserver in the server manager).

  • Revenue recognition has been executed twice

    HI all
    G/L Balance is not correct as below.
    It looks that some of revenue recognition has been executed twice. There are both items that revenue recognition has been executed twice and items that revenue recognition has been executed once within the same sales order.  I have no idea whether there is any pattern exists or not.  This issue needs to be solved by today .
    what could be the reason, can any one help me on this.
    Thanks in advance,
    Raju

    Hi Raju,
    Can u explain us in detail,
    It can be the reason like if the revenue recog is replicating through some nightly job, there r different cases it may ran twice(relication has done twice).
    Best regards
    Bhupathi.

  • Init() method is executing twice

    Hi,
    I have a servlet & implemented the init() method. But, the init() method is executing twice.
    Also, the destroy() method is executing twice.
    Any input guys.
    Thanks

    JAXMServlet most certainly IS an HttpServlet - the javadocs that I see say it extends HttpServlet. It won't be very useful in a SOAP implementation if it's not.
    I thought the SingleThreadModel interface. Why? I thought that was a bad practice that was discouraged. What writable data members does this "test" servlet have that require such careful treatment? If your servlet implements doGet and doPost methods, with only local variables, it'll be thread-safe enough.
    I follow the Sun Java coding standards, even for dash-off classes. "test" should be capitalized. Is there no more descriptive name you can think of?
    I'm not aware of a problem with Tomcat, and I haven't checked the bug list. But I'd put my money on your code being the problem here. Do you call super.init() in your servlet's init() method? Maybe you're seeing the superclass init() being called?
    %

  • ActionPerformed-method executed twice...

    Please help!
    My program behaves strangely; the actionPerformed method on a button is executed twice. The first execution completes the method as it should and makes changes to the model as it should. Then there comes the second execution triggered BY THE SAME BUTTON AT THE SAME TIME as the first execution. How is this possible? And how to fix things? There are no external triggers to the button.
    Here is the example code showing the method actionPerformed and the output that it prints.
    * Method to run when an answer is selected
    public void actionPerformed(ActionEvent arg0) {
    // Printout info on the action
    System.out.println("EKO actionPerformed-method at beginning. Game level " + mymodel.getLevel());
    System.out.println("EKO action command: " + arg0.getActionCommand());
    System.out.println("EKO action was: " + arg0.ACTION_PERFORMED);
    System.out.println("EKO action time: " + arg0.getWhen());
    // Disable buttons
    enableButtons(false);
    // Call method setVastattu to notify the observers that an answer
    // has already been selected (e.g. probressBar needs to be stopped)
    mymodel.setAnswered();
    if (arg0.getActionCommand()==mymodel.getKysymys()[1])
    System.out.println("EKO answer was correct. Game level " + mymodel.getLevel());
    // Call a method to set new choice texts on the buttons and to set the game level one higher
    mymodel.levelUp();
    System.out.println("EKO after levelUp-method. Game level " + mymodel.getLevel());
    else {
    JOptionPane.showMessageDialog(this, "Wrong answer!");
    mymodel.setWrongAnswer();
    EKO actionPerformed-method at beginning. Game level 1
    EKO action command: Kuurupiilo
    EKO action was: 1001
    EKO action time: 1133534802433
    EKO answer was correct. Game level 1
    EKO levelUp method is setting game level to level 2
    EKO after levelUp-method. Game level 2
    EKO actionPerformed-method at beginning. Game level 2
    EKO action command: Punahilkka
    EKO action was: 1001
    EKO action time: 1133534805567
    EKO answer was correct. Game level 2
    EKO levelUp method is setting game level to level 3
    EKO after levelUp-method. Game level 3
    EKO actionPerformed-method at beginning. Game level 3 <= WHY AGAIN???
    EKO action command: Punahilkka <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action was: 1001 <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action time: 1133534805567 <= EVEN THE ACTION TIME IS THE SAME...

    WOW!
    Exactly! I indeed had the actionlistener added twice. I did not even know that it is possible to have several overlapping actionlisteners! Now my code works fine. Thank you very, very much!
    Elisa

Maybe you are looking for

  • T530: Unbearable fan noise

    Probably similar to this thread, the T530 I recently received has fan noise issues. I've invested considerable time in solving this, but found that a solution can be achieved with reasonable effort only by Lenovo: Introduction: Most ThinkPad models d

  • Privacy settings on photoshop express app

    I downloaded the photoshop express app to my iphone.  I initially chose not to allow it to 'work' from my camera roll.  Now, I realize I do need that and need to find how to allow this.  The directions are to go the privacy settings and change.  Howe

  • I would like to fix my iphone

    My iphno always shows the white apple on the screen and do not start up, what shoud i do.?

  • IOS 5 and itunes errors

    "The Software for the iPhone was corrupted during download. Disconnect and reconnect, then try again. Make sure your network settings are correct and your connection is active, or try again later."

  • Function module  ''ADDR_GET"

    Hello, I am working on a program which uses the function module 'ADDR_GET' which imports 'SADR' ( Company Data ). The structure SADR contains a field SPRAS (Lnaguage key) which is no where in the whole function module gets filled up. Just because SPR