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!

Invoking doSubmit() with custom value doesn't fire update process

Keith M Swartz-OracleJul 14 2010 — edited Jul 14 2010
I have a page with a standard form that has a Save button, but also a button that I manually created via an anonymous PL/SQL block in the Item source of a field on the form. (I did this because I was already using a PL/SQL block to display the value of the item, but wanted the button to update it to appear immediately next to it, rather than somewhere on the page template.

Originally, this button was just a simple redirect to a separate detail page, but I found that if the user made changes to the form and then hit this button, those changes would be lost. So I changed it to a doSubmit() call instead. But in order to distinguish between the user hitting the Save button, and this Custom button, I had the button invoke doSubmit('CUSTOM'). I then created a branch that checked the value of the request, and went to the appropriate page depending on which button was pressed.

What I found was that the process to update the table underlying the form was not firing, even though it is unconditional, and so updates to the original form were still being lost.

I finally worked around this by modifying the button so that instead of calling doSubmit with a custom value, it called a JavaScript function that: 1) set a hidden field to '1', and 2) called doSubmit('SAVE'). I then changed the branch to look at the value of that hidden field, rather than the request value. That worked fine.

So this got me thinking: why didn't my original implementation work?

I suspect that doSubmit() only works with custom values if you have defined an actual button in the ApEx Designer and configured it with a name for that custom value. Even though the HTML for my button looks indistinguishable from a button created by ApEx, I'm thinking that there is something happening behind the scenes so that doSubmit() can't just work with any random value.

Can anyone confirm or deny this hypothesis?
This post has been answered by jariola on Jul 14 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2010
Added on Jul 14 2010
2 comments
749 views