Skip to content
Merged

Dev #36

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/01/z2ui5_cl_layo_sample_01.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ CLASS z2ui5_cl_layo_sample_01 IMPLEMENTATION.

mo_layout->set_selkz( t_event_arg = client->get( )-t_event_arg ).


WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).

Expand All @@ -56,7 +55,6 @@ CLASS z2ui5_cl_layo_sample_01 IMPLEMENTATION.

ENDCASE.


client->view_model_update( ).

ENDMETHOD.
Expand Down Expand Up @@ -172,13 +170,8 @@ CLASS z2ui5_cl_layo_sample_01 IMPLEMENTATION.
DATA(app) = CAST z2ui5_cl_layo_pop( client->get_app( client->get( )-s_draft-id_prev_app ) ).
mo_layout = app->mo_layout.

IF app->mv_rerender = abap_true.
" e.g. subcolumns need rerendering to work ..
render_main( ).
ELSE.
" for all other changes in Layout View Model Update is enough.
client->view_model_update( ).
ENDIF.
render_main( ).

CATCH cx_root.
ENDTRY.

Expand Down
20 changes: 12 additions & 8 deletions src/03/z2ui5_cl_layo_manager.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ CLASS z2ui5_cl_layo_manager IMPLEMENTATION.

ASSIGN mr_data->* TO <table>.

IF <table> IS NOT ASSIGNED.
RETURN.
ENDIF.

IF <table> IS INITIAL.
RETURN.
ENDIF.
Expand Down Expand Up @@ -835,22 +839,22 @@ CLASS z2ui5_cl_layo_manager IMPLEMENTATION.

METHOD get_conversion_exit.

DATA t_obj TYPE REF TO data.
DATA s_obj TYPE REF TO data.
DATA string type string.
DATA string TYPE string.
DATA t_obj TYPE REF TO data.
DATA s_obj TYPE REF TO data.

FIELD-SYMBOLS <T_obj> TYPE STANDARD TABLE.

result = layout.

TRY.

string = 'DD_X031L_TABLE'.
string = 'DD_X031L_TABLE'.

CREATE DATA t_obj TYPE (string).
CREATE DATA s_obj TYPE LINE OF (string).
ASSIGN t_obj->* TO <T_obj>.
ASSIGN s_obj->* TO FIELD-SYMBOL(<obj>).
CREATE DATA t_obj TYPE (string).
CREATE DATA s_obj TYPE LINE OF (string).
ASSIGN t_obj->* TO <T_obj>.
ASSIGN s_obj->* TO FIELD-SYMBOL(<obj>).

CALL METHOD type->('GET_DDIC_OBJECT')
RECEIVING p_object = <t_obj>
Expand Down
2 changes: 1 addition & 1 deletion src/03/z2ui5_cl_layo_manager.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>5</UNICODE>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
Expand Down
37 changes: 16 additions & 21 deletions src/03/z2ui5_cl_layo_pop.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ CLASS z2ui5_cl_layo_pop DEFINITION
TYPES END OF ty_s_layo.
TYPES ty_t_layo TYPE STANDARD TABLE OF ty_s_layo WITH EMPTY KEY.

TYPES: BEGIN OF ty_s_col,
col TYPE c LENGTH 2,
END OF ty_s_col.

DATA t_col TYPE STANDARD TABLE OF ty_s_col.

DATA mo_layout TYPE REF TO z2ui5_cl_layo_manager.
DATA mt_controls TYPE z2ui5_cl_layo_manager=>ty_t_controls.
DATA mt_layout TYPE z2ui5_cl_layo_manager=>ty_t_positions.
Expand Down Expand Up @@ -117,7 +123,6 @@ CLASS z2ui5_cl_layo_pop DEFINITION
METHODS check_grid_sum
IMPORTING
!value TYPE int4
!type TYPE string
RETURNING
VALUE(result) TYPE abap_bool.

Expand Down Expand Up @@ -1095,14 +1100,10 @@ CLASS z2ui5_cl_layo_pop IMPLEMENTATION.

WHEN `GRIDLAYOUT_CONFIRM`.

IF check_grid_sum( value = mv_xl_label + mv_xl_value
type = 'XL' )
OR check_grid_sum( value = mv_l_label + mv_l_value
type = 'L' )
OR check_grid_sum( value = mv_m_label + mv_m_value
type = 'M' )
OR check_grid_sum( value = mv_s_label + mv_s_value
type = 'S' ) = abap_true.
IF check_grid_sum( value = mv_xl_label + mv_xl_value )
OR check_grid_sum( value = mv_l_label + mv_l_value )
OR check_grid_sum( value = mv_m_label + mv_m_value )
OR check_grid_sum( value = mv_s_label + mv_s_value ) = abap_true.

ELSE.

Expand All @@ -1121,6 +1122,8 @@ CLASS z2ui5_cl_layo_pop IMPLEMENTATION.
layout->grid_label_m = mv_m_label.
layout->grid_label_s = mv_s_label.

mt_layout = mo_layout->ms_layout-t_layout.

init_edit( ).
render_edit( ).

Expand All @@ -1136,27 +1139,19 @@ CLASS z2ui5_cl_layo_pop IMPLEMENTATION.
ENDMETHOD.

METHOD check_grid_sum.
" TODO: parameter TYPE is never used (ABAP cleaner)

IF ( value ) > 12.
DATA(msg) = z2ui5_cl_util=>msg_get_by_msg( id = '/scmtms/common'
no = '154'
v1 = '12' ).

result = abap_true.
ENDIF.

client->message_toast_display( msg-text ).
client->message_toast_display( 'Maximum number of columns (12) exceeded' ).

ENDIF.

ENDMETHOD.

METHOD render_add_gridlayout.

TYPES: BEGIN OF ty_s_col,
col TYPE c LENGTH 2,
END OF ty_s_col.

DATA t_col TYPE STANDARD TABLE OF ty_s_col.

t_col = VALUE #( ( col = 1 )
( col = 2 )
( col = 3 )
Expand Down