mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 04:08:27 +08:00
Trigger main command when pressing enter in form (#4102)
* Triggers main command when pressing enter in form Adds hidden button that triggers main command when pressing the enter key * Lint Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
b408cad115
commit
5c1298697d
|
@ -285,6 +285,14 @@ CLASS ZCL_ABAPGIT_HTML_FORM IMPLEMENTATION.
|
|||
|
||||
ri_html->add( |<div class="{ iv_form_class }">| ).
|
||||
ri_html->add( |<form method="post"{ ls_form_id }>| ).
|
||||
|
||||
" Add hidden button that triggers main command when pressing enter
|
||||
LOOP AT mt_commands ASSIGNING <ls_cmd> WHERE is_main = abap_true.
|
||||
ri_html->add( |<button type="submit" formaction="sapevent:{ <ls_cmd>-action
|
||||
}" class="hidden-submit" aria-hidden="true" tabindex="-1"></button>| ).
|
||||
EXIT.
|
||||
ENDLOOP.
|
||||
|
||||
ri_html->add( |<ul>| ).
|
||||
|
||||
LOOP AT mt_fields ASSIGNING <ls_field>.
|
||||
|
|
Loading…
Reference in New Issue
Block a user