6 Replies Latest reply on May 13, 2019 9:04 PM by Frank Hoffmann-colognedata

    Forms can not distinguish between Mouse-CLICK and Mouse-Double-CLICK and executes WHEN-BUTTON-PRESSED two times

    Frank Hoffmann-colognedata

      Hello All,


      one of my customers who migrates from 6i to 12c found out, that Forms does not work correctly handle a When-Button-Pressed Trigger with a mouse-DOUBLE Click on a button.

      The behavior in is, that the Code of the button is fired twice. A message or alert could prevent this behavior but would be a bad workaround to add it in every button logic.


      You can easily reproduce the case:


      Create a form with a simply button.

      Add a "When-button-pressed" trigger with "null;" as code

      Create a WHEN-MOUSE-CLICK Trigger with "null;" as code

      Create a WHEN-MOUSE-DOUBLE-Click Trigger with "null;" as code

      Create a debug flag for all triggers.


      Start the form and double click on the button.


      In 6i the When-Button-Pressed Code is fired once.

      in the "When-Button-Pressed Code" is fired twice . Also both Mouse triggers (WHEN-MOUSE-CLICK and the WHEN-MOUSE-DOUBLE-Click fire).

      (Probably this is the reason is, that can not distinguish between the Click and the Doubleclick)


      Debugging has this sequence:


      Doubleclick on the button:

      (1) WBP clickcounter := 1

      (2) WMC

      (3) WBP clickcounter := 2

      (4) WMDC


      So doubleclick means two times WBP:



      I offered the customer to make a quick and dirty workaround by setting a parameter for 1 second with system System.Client_idle to prevent the second call of the WHEN-BUTTON-PRESSED trigger. This can be added to every WBP Trigger with Forms API Master.


      Every WBP Trigger:

      if :parameter.form_wbp = 1 then return; else if :cb_workaround = 1 then :parameter.form_wbp := 1; SET_APPLICATION_PROPERTY(CLIENT_IDLE_TIME,(1)); end if; end if;


      (1) WBP System Client Idle for 1 seconds - Parameter FORM_WBP 1

      (2) WMC

      (3) WBP return if FORM_WBP = 1 - click_counter := 1

      (4) WMDC


      Double Click on the Button:


      Has anyone a more clever solution? Or is there a way to change the behavior WHEN-BUTTON-PRESSED Trigger with a hidden Parameter in the Environment?


      Is this a bug or a feature?