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!

How to make Submit on Enter perform Update operation?

Kim Berg HansenJan 24 2025

Hi

APEX 24.1.7.

I have a form that for processing uses “Form - Automatic Row Processing (DML)”. I have a button SAVE with Action = “Submit Page” and Database Action = “SQL UPDATE action”. Works fine, it updates when button is pressed.

I have a page item where I want it to do the same when I press Enter.

I thought it'd be easy - on the item (if I use a text field) I can toggle “Submit when Enter pressed” and it submits the page when I press Enter. But the automatic row processing does not perform any update. I can understand this, because there is no way I can specify that the submission on Enter should have Database Action = “SQL UPDATE action”.

Then I tried a dynamic action on event Key Press on the item with clientside condition javascript expression “this.browserEvent.which == 13”, and a True action of “Submit Page”. This action has an attribute “Request / Button Name” that I can set to SAVE, which I thought meant that this DA action emulates a press on the SAVE button. But it does not make the automatic row processing perform update either :-(

Then I tried as the True action of the DA to make it Execute Javascript Code with the code being "apex.submit( "SAVE" );" as this according to JS api doc should submit the page with a request of SAVE. No luck with that either. I've also tried with "apex.submit( "UPDATE" );" as request instead of the button name - still no luck :-(

I've looked in the debug info for details:

When I click the button SAVE (the good case), a debug view identifier is created with path info “Accept SAVE”. One of the messages is “get_database_operation p_action=>SAVE”, and later “we have 1 rows. Determining DML operation types”, and “we have rows to be UPDATED”, and “execute_dml.do_execute_dml p_dml_operation=>2”.

All the ways I have tried to make Enter do a SAVE/UPDATE submit ends up with a debug view identifier that just has path info “Accept”, and there's message “get_database_operation p_action=>” with no value for p_action. Further on in the debug I do get “we have 1 rows. Determining DML operation types”, but I do not get “we have rows to be UPDATED” and therefore also no do_execute_dml.

How can I make an Enter keypress perform a submit in such a way that it becomes an Update operation in the automatic row processing ?

This post has been answered by jariola on Jan 24 2025
Jump to Answer
Comments
Post Details
Added on Jan 24 2025
7 comments
700 views