Hi,
I use the g_print_success_message procedure a lot. In combination within my template code I get some trouble.
I created the template messages similar to the following example: http://www.jankoatwarpspeed.com/post/2008/05/22/CSS-Message-Boxes-for-different-message-types.aspx
Means success becomes green box and error becomes a red box. If I create dynamic error messages this template technique doesn't work anymore, because I only have the apex_application.g_print_success_message procedure. I need something like g_print_notification_message or g_notification to publish the right template.
Here is my source code of a procedure:
DECLARE
RetVal VARCHAR2(100);
BEGIN
RetVal := PKG_TEST.F_TEST(1);
if SUBSTR(RetVal,1,1) = '1' then
apex_application.g_print_success_message := '<span style="color:green">User got successfully created.</span>';
elsif SUBSTR(RetVal,1,1) = '2' then
apex_application.g_print_success_message := '<script><span style="color:orange">User got created, but date could not be set.</span>';
elsif SUBSTR(RetVal,1,1) = '3' then
apex_application.g_print_success_message := '<script><span style="color:red">Known Problem in package, please set user value to 100.</span>';
else
apex_application.g_print_success_message := '<span style="color:red">Unknown error occurred.</span>';
end if;
COMMIT;
END;
I would be glad for some ideas.
A workaround could be that:
apex_application.g_print_success_message := '<script>$(".mySuccess").addClass("myNotification");$(".myNotification").removeClass("mySuccess")
</script><span style="color:red">Known Problem in package, please set user value to 100.</span>';
Seems a bit complex to be a nice solution.
Best regards,
Tobias