Forum Stats

  • 3,824,917 Users
  • 2,260,439 Discussions
  • 7,896,346 Comments

Discussions

WHEN-TREE-NODE-EXPANDED is not firing

Scott Hollows
Scott Hollows Member Posts: 104 Blue Ribbon
edited Jun 11, 2022 12:51AM in Forms

Do you have any idea why an WHEN-TREE-NODE-EXPANDED trigger fails to fire in my form ?

My form has a tree with an item level WHEN-TREE-NODE-EXPANDED trigger.

Node 2.1 is initially collapsed.


The trigger usually fires when the user clicks on the NODE 2.1 (+) but it fails to fire about 1 in 20 time when testing. The node expands, but the trigger does not fire

There are no other WHEN-TREE-NODE-EXPANDED triggers at the form or block level

The test case is simple and reproducible in the application so I am very confident that the trigger is not firing. ... open the form, navigate to a tab that has the tree control on it, the tree will be populated with data. click on the (+) link to expand one of the nodes in the tree

Environment Forms 11.1.2.2.0, Java 8 update 66, client Windows 10 v1809

Any ideas on why WHEN-TREE-NODE-EXPANDED it fails to fire every time ?

Answers

  • Hub Tijhuis
    Hub Tijhuis Member Posts: 177 Gold Badge

    Does it fail to fire or does the node not expand?

    Add messages to verify : for example at the end of the trigger

    show_message('Succes ' || to_char(sysdate,'MI-SS'));

    exception

    when form_trigger_failure then show_mesage('Failure ' || to_char(sysdate,'MI-SS'));raise;

    when others then show_message(Others ' || to_char(sysdate,'MI-SS'));raise;


    Does the node expand if you click it a second time? If no, what have you to do to resume expanding?

    What happens within the trigger?

  • Scott Hollows
    Scott Hollows Member Posts: 104 Blue Ribbon

    Hey Hub

    The node expands correctly but the trigger does not fire

    I have removed the trigger code and replaced it with just a simple message but the message does not appear. I have also tried logging text to a file in case the message was getting intercepted in ON-ERROR or ON-MESSAGE triggers but the same thing ... the trigger does not appear to be firing at all.

  • Hub Tijhuis
    Hub Tijhuis Member Posts: 177 Gold Badge

    "Does not appear to be firing at all" : does it now always or again about 1 in 20 times?

    Unlikely 1, check if there exist the same trigger on a higher level (block/form) and if there is a change in default trigger Execution Hierarchy causing that other trigger to be fired first (and maybe only).

    Unlikely 2, check if there are timers set and when_timer_expired triggers can fire that can explain that differences in time can explain differences in behaviour

    Unlikely 3. I don't know the options in your current forms version, but in the past I "solved" some strange problems by converting the fmb to a text format and back to fmb. In this situation I would remove the trigger before the conversion and add it again after conversion back to fmb.

  • Scott Hollows
    Scott Hollows Member Posts: 104 Blue Ribbon

    Hub


    ** "Does not appear to be firing at all" : does it now always or again about 1 in 20 times?

    It is very random. I can do the exact same steps and it only fails to fire 1 in 20 times. It could be the first 1st of 10th or 20th time ... but almost always before the 20th time


    ** Unlikely 1, check if there exist the same trigger on a higher level (block/form) and if there is a change in default trigger Execution Hierarchy causing that other trigger to be fired first (and maybe only).

    There are no other node triggers in the form


    ** Unlikely 2, check if there are timers set and when_timer_expired triggers can fire that can explain that differences in time can explain differences in behaviour

    There is no when-timer-expired trigger in the form


    ** Unlikely 3. I don't know the options in your current forms version, but in the past I "solved" some strange problems by converting the fmb to a text format and back to fmb. In this situation I would remove the trigger before the conversion and add it again after conversion back to fmb.

    Done already - same issue

    I have also recompiled the form and all libraries attached to the form.


    Thanks for the feedback. Some good ideas there

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,194 Employee

    Exactly (e.g. 12.2.1.3, 10.1.2.2, etc) which Forms version and which Java version on the user’s machine?


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

  • Scott Hollows
    Scott Hollows Member Posts: 104 Blue Ribbon

    Forms 11.1.2.2.0

    Java 8 update 66

    Our upgrade process is very slow so upgrading Forms or Java is not an option

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,194 Employee

    Our upgrade process is very slow..

    This is a bit of an understatement. Forms 12.2.1 has been available since 2015 (approximately 7 years ago). Java 8u66 was also released in 2015. This is not a good practice. With such long upgrade cycles, your environment may be at risk. It seems that addressing this issue should be priority #1 over developing new code.

    Regarding the issue you reported, I tested in 12.2.1.4 (on a Windows server and Windows client) with Java 8u331 and mostly (see my final comment below) cannot reproduce what you described. The trigger fires every time a node is expanded (or collapsed). For the sake of completeness, I also tested in a nightly build of the next planned major release (running on a Linux server) and again, the problem does not reproduce.

    That said, I was able to reproduce what you claimed IF I clicked on the node symbol repeatedly within about a one second period. In other words, if I tried to open then immediately click the same node again quickly. I also noted that the reproducibility seems to be tied to how much plsql is in the trigger and how complex it is. The simpler the plsql the more likely the problem would reproduce. Here is an example:

    -- THIS REPRODUCES
       CLEAR_MESSAGE;
       MESSAGE ('Fired' || ' at ' || to_char(CURRENT_TIMESTAMP,'HH24:MI:SS'));
    

    Note that the only difference below is the addition of the fractions of a second. However, with this change the problem does not reproduce.

    -- THIS DOES NOT REPRODUCE
       CLEAR_MESSAGE;
       MESSAGE ('Fired' || ' at ' || to_char(CURRENT_TIMESTAMP,'HH24:MI:SS.FF'));
    

    This issue can be investigated by Forms Development, however if it is something that can be corrected a fix would only be provided to 12.2.1.4+. It is also possible that the issue cannot be corrected.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,194 Employee

    @Scott Hollows

    My previous response (above) can be ignored.

    Upon further investigation, I can see that I am not reproducing the problem. Rather what I was seeing is that the node symbol was being clicked multiple times within the same second. The result is that it gave the appearance of the trigger not firing when really it was firing.

    So, that leaves me to say that the problem you described is not reproducible in 12.2.1.4 using newer Java versions.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

  • Scott Hollows
    Scott Hollows Member Posts: 104 Blue Ribbon

    Thanks you for investigating Michael

    I will notify my team about your finding

    The customer is aware that they are well behind on software versions and need to upgrade


    regards

    Scott Hollows