Tuesday, April 11, 2017

Auto-dismiss APEX Universal theme success messages

In the APEX 5.1.1 Universal Theme demonstration application, a code snippet is included showing how to automatically dismiss Success messages via JavaScript using the apex.theme42.configureSuccessMessages API.
Trouble is it only works in some circumstances, as can be seen in screenshot from a demonstration application below.


You can try the demo application to observe the issue, and a solution that works right now. You can download the application, which probably works on earlier versions of the Universal theme - I haven't tested it.

3 comments:

Stew said...

For those of us who can't upgrade to 5.1.1 in the near future, is there any chance this snippet could be applied to existing applications in, say version 5.0.4?
Or does someone have an add-on script that would implement this?

TIA,

Stew

sathya said...

These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post. Your articles really impressed for me,because of all information so nice.

Dataware Housing Training in Chennai

michael.b said...

@Stew: I created a dynamic action to do that in Apex 5.0
Event: Page Load
Action: Execute JavaScript Code
Code:
$('div#t_Alert_Success').closest('div.t-Body-alert').delay(4000).fadeOut();

To auto-dismiss not only success messages but the error message region as well you can use
$('div.t-Body-alert').delay(4000).fadeOut();