Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev committed Feb 23, 2024
1 parent 20fd9ba commit 48d9387
Showing 1 changed file with 45 additions and 51 deletions.
96 changes: 45 additions & 51 deletions src/z2ui5_cl_demo_app_174.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ CLASS z2ui5_cl_demo_app_174 DEFINITION PUBLIC.
TYPES ty_t_table TYPE STANDARD TABLE OF ty_s_tab WITH EMPTY KEY.

DATA mt_table TYPE ty_t_table.

DATA ms_layout TYPE z2ui5_cl_popup_layout_v2=>ty_s_layout.

PROTECTED SECTION.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
DATA mv_check_initialized TYPE abap_bool.
METHODS on_event.
Expand All @@ -40,9 +39,8 @@ CLASS z2ui5_cl_demo_app_174 IMPLEMENTATION.
METHOD on_event.

CASE client->get( )-event.

WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
client->nav_app_leave( ).
WHEN OTHERS.
on_event_layout( ).
ENDCASE.
Expand Down Expand Up @@ -87,40 +85,36 @@ CLASS z2ui5_cl_demo_app_174 IMPLEMENTATION.
DATA(headder) = table->header_toolbar(
)->overflow_toolbar(
)->title( text = 'Table'
)->toolbar_spacer(
).
)->toolbar_spacer( ).

headder = z2ui5_cl_popup_layout_v2=>render_layout_function( xml = headder
client = client ).
headder = z2ui5_cl_popup_layout_v2=>render_layout_function( xml = headder client = client ).

DATA(columns) = table->columns( ).


LOOP AT ms_layout-t_layout REFERENCE INTO DATA(layout).
DATA(lv_index) = sy-tabix.

columns->column(
visible = client->_bind( val = layout->visible tab = ms_layout-t_layout tab_index = lv_index )
halign = client->_bind( val = layout->halign tab = ms_layout-t_layout tab_index = lv_index )
visible = client->_bind( val = layout->visible tab = ms_layout-t_layout tab_index = lv_index )
halign = client->_bind( val = layout->halign tab = ms_layout-t_layout tab_index = lv_index )
importance = client->_bind( val = layout->importance tab = ms_layout-t_layout tab_index = lv_index )
mergeduplicates = client->_bind( val = layout->merge tab = ms_layout-t_layout tab_index = lv_index )
minscreenwidth = client->_bind( val = layout->width tab = ms_layout-t_layout tab_index = lv_index )
mergeduplicates = client->_bind( val = layout->merge tab = ms_layout-t_layout tab_index = lv_index )
minscreenwidth = client->_bind( val = layout->width tab = ms_layout-t_layout tab_index = lv_index )
)->text( layout->fname ).

ENDLOOP.


DATA(cells) = columns->get_parent( )->items(
)->column_list_item( valign = 'Middle'
type = 'Navigation'
press = client->_event( val = 'ROW_SELECT'
t_arg = VALUE #( ( `${ROW_ID}` ) ) )
)->cells( ).
)->column_list_item( valign = 'Middle'
type = 'Navigation'
press = client->_event(
val = 'ROW_SELECT'
t_arg = VALUE #( ( `${ROW_ID}` ) ) )
)->cells( ).

LOOP AT ms_layout-t_layout REFERENCE INTO layout.

cells->object_identifier( text = '{' && layout->fname && '}' ).

ENDLOOP.

client->view_display( view->stringify( ) ).
Expand All @@ -136,16 +130,15 @@ CLASS z2ui5_cl_demo_app_174 IMPLEMENTATION.
mv_check_initialized = abap_true.

set_data( ).

create_layout( ).

view_display( ).

RETURN.

ENDIF.

on_after_layout( ).
IF client->get( )-check_on_navigated = abap_true.
on_after_layout( ).
RETURN.
ENDIF.

IF client->get( )-event IS NOT INITIAL.
on_event( ).
Expand All @@ -155,46 +148,47 @@ CLASS z2ui5_cl_demo_app_174 IMPLEMENTATION.

METHOD create_layout.

DATA: tab TYPE REF TO data.
DATA: lr_tabdescr TYPE REF TO cl_abap_tabledescr.
FIELD-SYMBOLS: <fs_tab> TYPE ANY TABLE.

lr_tabdescr ?= cl_abap_tabledescr=>describe_by_data( mt_table ).
CREATE DATA tab TYPE HANDLE lr_tabdescr.
ASSIGN tab->* TO <fs_tab>.
<fs_tab> = mt_table.

DATA(class) = cl_abap_classdescr=>get_class_name( me ).

ms_layout = z2ui5_cl_popup_layout_v2=>init_layout(
tab = tab
classname = CONV #( class ) ).
tab = REF #( mt_table )
classname = z2ui5_cl_util=>rtti_get_classname_by_ref( me ) ).

ENDMETHOD.


METHOD on_after_layout.

IF client->get( )-check_on_navigated = abap_true.

TRY.
DATA(app) = CAST z2ui5_cl_popup_layout_v2( client->get_app( client->get( )-s_draft-id_prev_app ) ).
ms_layout = app->ms_layout.
view_display( ).
TRY.
DATA(app) = CAST z2ui5_cl_popup_layout_v2( client->get_app( client->get( )-s_draft-id_prev_app ) ).
ms_layout = app->ms_layout.
view_display( ).

CATCH cx_root.
ENDTRY.

ENDIF.
CATCH cx_root.
ENDTRY.

ENDMETHOD.


METHOD on_event_layout.

client = z2ui5_cl_popup_layout_v2=>on_event_layout(
client = client
layout = ms_layout ).

CASE client->get( )-event.

WHEN 'LAYOUT_OPEN'.
client->view_destroy( ).
client->nav_app_call( z2ui5_cl_popup_layout_v2=>factory( layout = ms_layout
open_layout = abap_true ) ).

WHEN 'LAYOUT_EDIT'.
client->view_destroy( ).
client->nav_app_call( z2ui5_cl_popup_layout_v2=>factory( layout = ms_layout
extended_layout = abap_true ) ).

WHEN 'LAYOUT_DELETE'.
client->view_destroy( ).
client->nav_app_call( z2ui5_cl_popup_layout_v2=>factory( layout = ms_layout
delete_layout = abap_true ) ).

ENDCASE.

ENDMETHOD.

Expand Down

0 comments on commit 48d9387

Please sign in to comment.