+1

Ever have an issue with oninit action loading more than once?

sovtek 7 years ago updated by icahill (Administrator) 7 years ago 5
<!-- On Init Action -->

This simple code will load an alert message 3x's on load within my app.
Anything you can tell me that would be causing it to do this?
Are you loading sub wires oninit as well?
This is the only thing im loading on init right now. For some reason it didn't show in the original question.

< action name="oninit" oninit="yes" >
< alert message="test" />
</ action >
If you are viewing this in fusebox during a 'update content' then the alert could pop before and after the update. This should not happen otherwise.

Are you seeing this happen even without a content update?
That may be the case. It seems the alert box loads before the app is fully loaded, disappears on its own, then appears again. I am then able to close it, and then it appears a 3rd time where I close it again.
You could consider putting the alert in a sync block and setting a delay on it, this should help the issue. Though in an ad-hoc or release build you won't be seeing updates as frequently as in fusebox.