Do you recognize the situation that you have coded a nice JavaScript Dynamic Action to respond on user input, you run the page and you notice unwanted behaviour when loading the page?
Oh no, forgot to uncheck the
Fire on page load option! It happens to me all the time!
In Oracle Apex JavaScript DA steps have the option
Fire on page load checked by default, as you will all be aware. PL/SQL steps have it default unchecked.
I stumble regularly over forgetting to uncheck the option. Most of the DA’s I write are about responding on user actions so I normally do not want them to execute on page load. Not unchecking the option results in unwanted behaviour which is not always obvious. One time it has cost me a few hours to come to the conclusion I should uncheck it.
I would like to have the option default unchecked. This ranks high on my Apex enhancement requests list.
To back this I decided to examine how many Javascript DA steps still have the Fire on page load option active in the application I currently work on together with 5 other developers.
This is the result:
Execute on Page Load | Number |
No | 365 |
Yes | 132 |
The ratio between unchecked and checked is 2,7! A good argument for me to have the option default unchecked.
What about the Apex builder? A query on the Apex repository for application ID’s between 4000 and 5000 results in :
Execute on Page Load | Number |
No | 86 |
Yes | 36 |
Also in their own work it would be an advantage to uncheck by default!
But how about your application? I am curious what the ratio is in your application.
If you fire the query below you can find out.
select execute_on_page_init, count(*)
from apex_application_page_da_acts
where action_code = 'NATIVE_JAVASCRIPT_CODE'
and application_name = 'appname
group by execute_on_page_init;
You can fill in the application name at appname or omit this line to query the whole Apex repository.
Please you post the results on
www.speech2form.com/da_survey.
If your results also show a majority for the unchecked steps I will try to convince the Apex team of unchecking the option by default for JavaScript DA steps.
#letswreckthistogether ;-).
Happy apexing,
Dick Dral