Form On Add -> On Load executed twice
I have the following simple form with no fields, just a debug statement in the On Load and On Success of the On Add section of the form. the debug function just writes out the parameters to a debug form.
form DoubleOnLoad
{
success message = "Data Added Successfully!"
field alignment = left
actions
{
on add
{
on load
{
// Test to see if the on load executes twice
thisapp.com.debug(1, "On Add", "On Load", "");
}
submit
(
type = submit
displayname = "Submit"
on success
{
thisapp.com.debug(1, "On Add", "On Success", "");
}
)
reset
(
type = reset
displayname = "Reset"
)
}
on edit
{
update
(
type = submit
displayname = "Update"
)
cancel
(
type = cancel
displayname = "Cancel"
)
}
}
}
Here is the output of the debug records:
| 01-23-16 13:11:10 |
1 |
On Add |
On Load |
| 01-23-16 13:11:09 |
1 |
On Add |
On Success |
| 01-23-16 13:10:53 |
1 |
On Add |
On Load |
It is showing that the On Load section is apparently executed twice. What's worse the timestamps indicate the second execution is after the On Success section. This is a simple example of what I've found in my actual application. It's playing havoc with my code in these sections.