Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Pop up dialog box for debug (APEX 4.2)
Pop up dialog box for debug [message #656172] Mon, 26 September 2016 10:26 Go to next message
Janning
Messages: 42
Registered: April 2016
Member

Hi,

If this is at all possible, is likely an easy answer. What I am looking for is a way to display to the screen (preferably a dialog box) the values in variables as a page is running.
Lets say for example I have an APEX page, which lists records of information. I also have a checkbox as the first column on the left.
I select several of the records and I click my Delete button. Over in Page Processing, I have a process, in After Submit, called
"Remove_records" Within this I have the below

For I in 1..APEX_APPLICATION.G_F8.COUNT
Delete from table_name a where record_id = APEX_APPLICATION.G_F8(I));
END LOOP;

What I am looking for is something like this:

For I in 1..APEX_APPLICATION.G_F8.COUNT
My_output_to_screen('Deleting record_id '||APEX_APPLICATION.G_F8(I) );
Delete from table_name a where record_id = APEX_APPLICATION.G_F8(I));

END LOOP;

Obviously the " My_output_to_screen('Deleting record_id '||APEX_APPLICATION.G_F8(I) );" is something I just typed in,

My question is what is the correct syntax, used in place of this, which would show it when I run the app? I'm envisioning it being a dialog box,
showing the below, with an OK button to continue to the next record_id:

Deleting record_id 12345


Re: Pop up dialog box for debug [message #656173 is a reply to message #656172] Mon, 26 September 2016 13:27 Go to previous messageGo to next message
Janning
Messages: 42
Registered: April 2016
Member

I tried using the below, and it did show up, if I turn debug on and then go view debug.
I know for certain, it is getting inside of the loop, cause it is deleting records. Keep in mind this is in the Page Processing, I have a process, in After Submit.
Is there a way to have this display on the page as a dialog, instead of in debug log?

For I in 1..APEX_APPLICATION.G_F8.COUNT
wwv_flow.debug('text to be displayed on screen');
apex_debug.message('Test! ');

Delete from table_name a where record_id = APEX_APPLICATION.G_F8(I));
END LOOP;
Re: Pop up dialog box for debug [message #656180 is a reply to message #656173] Tue, 27 September 2016 03:09 Go to previous messageGo to next message
Littlefoot
Messages: 21608
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try APEX_APPLICATION.G_PRINT_SUCCESS_MESSAGE. For example:

apex_application.g_print_success_message := l_cnt || ' rows deleted';

It is displayed on a top of the screen (just as built-in Apex messages), so I'm not sure you'll benefit from it much (as it certainly isn't a dialog box). Moreover, even if you put it into a loop, I *think* that it'll display just the last ID being deleted.

However: why would you want to do that, anyway? Imagine someone deletes 3 records and confirms 3 of them. Fine. Now imagine someone deletes 57 records and has to click 57 times "OK" - that's annoying.

Furthermore, what you described (a form with checkboxes etc.) looks like a tabular form, but it appears that you wrote the one on your own. Why? An Apex tabular form already has all those functionalities (row selector at the beginning of every line, DELETE button, deletes only selected rows ...) so - why wouldn't you use it?

Finally: obviously, I'm unable to answer your question. Sorry.
Re: Pop up dialog box for debug [message #656188 is a reply to message #656180] Tue, 27 September 2016 08:19 Go to previous message
Janning
Messages: 42
Registered: April 2016
Member

I want to use this for my own debugging, and not necessarily on the snipit of example code I gave. I would not leave this in for production.
I'm aware of the built in delete capabilities,,,as I said this is just an example.
And yes apex_application.g_print_success_message only shows the one most recent value.
Previous Topic: APEX 5 deploy with WebLogic setting REMOTE_USER
Next Topic: oracle apex 5 tabular forms column to column calculation
Goto Forum:
  


Current Time: Tue Oct 20 21:17:25 CDT 2020