mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Empty tables in HTML forms (#4658)
Previously if there were no data rows, it would render just the column headers of the table. After this change, it shows "Not available". Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
1104c88e48
commit
18c9b404f1
|
@ -644,6 +644,11 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
|
|||
ii_html->add( is_attr-error ).
|
||||
ENDIF.
|
||||
|
||||
lv_rows = io_values->get( |{ is_field-name }-{ zif_abapgit_html_form=>c_rows }| ).
|
||||
|
||||
" Render table only if there are some data rows
|
||||
IF lv_rows > 0.
|
||||
|
||||
ii_html->add( |<table name="{ is_field-name }" id="{ is_field-name }" class="table-container">| ).
|
||||
|
||||
ii_html->add( |<thead>| ).
|
||||
|
@ -660,8 +665,6 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
|
|||
ii_html->add( |</tr>| ).
|
||||
ii_html->add( |</thead>| ).
|
||||
|
||||
lv_rows = io_values->get( |{ is_field-name }-{ zif_abapgit_html_form=>c_rows }| ).
|
||||
|
||||
ii_html->add( |<tbody>| ).
|
||||
DO lv_rows TIMES.
|
||||
lv_rows = sy-index.
|
||||
|
@ -683,6 +686,11 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
|
|||
|
||||
ii_html->add( |</table>| ).
|
||||
|
||||
ELSE.
|
||||
ii_html->add( |<input type="text" name="{ is_field-name }" id="{
|
||||
is_field-name }" value="Not available" readonly>| ).
|
||||
ENDIF.
|
||||
|
||||
" Hidden field with number of rows to simplify getting values from form
|
||||
lv_value = |{ is_field-name }-{ zif_abapgit_html_form=>c_rows }|.
|
||||
ii_html->add( |<input type="number" name="{ lv_value }" id="{
|
||||
|
|
Loading…
Reference in New Issue
Block a user