Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alternative to g_print_success_message like g_print_notification_message

Tobias ArnholdJan 11 2011 — edited Jan 11 2011
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
This post has been answered by 438381 on Jan 11 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2011
Added on Jan 11 2011
7 comments
5,167 views