Skip to content

Commit

Permalink
demos update (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
choper725 authored Mar 31, 2024
1 parent 975e400 commit d35977a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 56 deletions.
120 changes: 65 additions & 55 deletions src/z2ui5_cl_demo_app_099.clas.abap
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
CLASS Z2UI5_CL_DEMO_APP_099 DEFINITION
CLASS z2ui5_cl_demo_app_099 DEFINITION
PUBLIC
CREATE PUBLIC .

PUBLIC SECTION.

INTERFACES Z2UI5_if_app .
INTERFACES if_serializable_object .
INTERFACES z2ui5_if_app .

TYPES:
BEGIN OF ty_row,
Expand All @@ -14,40 +15,39 @@ CLASS Z2UI5_CL_DEMO_APP_099 DEFINITION
icon TYPE string,
info TYPE string,
selected TYPE abap_bool,
END OF ty_row.

DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.

END OF ty_row .
TYPES:
BEGIN OF ty_sort,
text TYPE string,
key TYPE string,
selected TYPE abap_bool,
END OF ty_sort.

DATA t_tab_sort TYPE STANDARD TABLE OF ty_sort WITH EMPTY KEY.
DATA t_tab_group TYPE STANDARD TABLE OF ty_sort WITH EMPTY KEY.
DATA t_tab_filter_title TYPE STANDARD TABLE OF ty_sort WITH EMPTY KEY.

DATA mv_sorter_group TYPE string.
DATA mv_filter TYPE string.

DATA mv_sort_descending TYPE abap_bool.
DATA mv_group_descending TYPE abap_bool.
DATA mv_group_desc_str TYPE string VALUE `false`.

END OF ty_sort .

DATA:
t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY .
DATA:
t_tab_sort TYPE STANDARD TABLE OF ty_sort WITH EMPTY KEY .
DATA:
t_tab_group TYPE STANDARD TABLE OF ty_sort WITH EMPTY KEY .
DATA:
t_tab_filter TYPE STANDARD TABLE OF ty_sort WITH EMPTY KEY .
DATA mv_sorter_group TYPE string .
DATA mv_filter TYPE string .
DATA mv_sort_descending TYPE abap_bool .
DATA mv_group_descending TYPE abap_bool .
DATA mv_group_desc_str TYPE string VALUE `false` ##NO_TEXT.
PROTECTED SECTION.

DATA client TYPE REF TO Z2UI5_if_client.
DATA client TYPE REF TO z2ui5_if_client.
DATA check_initialized TYPE abap_bool.

METHODS Z2UI5_set_data.
METHODS Z2UI5_view_display.
METHODS Z2UI5_view_sort_popup.
METHODS Z2UI5_view_filter_popup.
METHODS Z2UI5_view_group_popup.
METHODS Z2UI5_view_settings_popup.
METHODS Z2UI5_on_event.
METHODS z2ui5_set_data.
METHODS z2ui5_view_display.
METHODS z2ui5_view_sort_popup.
METHODS z2ui5_view_filter_popup.
METHODS z2ui5_view_group_popup.
METHODS z2ui5_view_settings_popup.
METHODS z2ui5_on_event.


PRIVATE SECTION.
Expand All @@ -58,37 +58,37 @@ ENDCLASS.
CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.


METHOD Z2UI5_if_app~main.
METHOD z2ui5_if_app~main.

me->client = client.

IF check_initialized = abap_false.
check_initialized = abap_true.

Z2UI5_set_data( ).
z2ui5_set_data( ).

Z2UI5_view_display( ).
z2ui5_view_display( ).
RETURN.
ENDIF.

Z2UI5_on_event( ).
z2ui5_on_event( ).

ENDMETHOD.


METHOD Z2UI5_on_event.
METHOD z2ui5_on_event.

CASE client->get( )-event.
WHEN 'BACK'.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
WHEN 'ALL'.
Z2UI5_view_settings_popup( ).
z2ui5_view_settings_popup( ).
WHEN 'SORT'.
Z2UI5_view_sort_popup( ).
z2ui5_view_sort_popup( ).
WHEN 'FILTER'.
Z2UI5_view_filter_popup( ).
z2ui5_view_filter_popup( ).
WHEN 'GROUP'.
Z2UI5_view_group_popup( ).
z2ui5_view_group_popup( ).
WHEN 'CONFIRM_SORT'.
DATA(lt_arg) = client->get( )-t_event_arg.

Expand Down Expand Up @@ -130,7 +130,7 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
mv_filter = mv_filter+0(mv_filter_len).


Z2UI5_view_display( ).
z2ui5_view_display( ).

ENDIF.

Expand All @@ -152,9 +152,18 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
mv_sorter_group = group_field.
TRANSLATE mv_sorter_group TO UPPER CASE.

ELSE.

IF mv_group_descending = abap_true.
SORT t_tab BY (group_field) DESCENDING.
ELSE.
SORT t_tab BY (group_field) ASCENDING.
ENDIF.

CLEAR mv_sorter_group.
ENDIF.

Z2UI5_view_display( ).
z2ui5_view_display( ).

ENDIF.

Expand All @@ -164,7 +173,7 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
ENDMETHOD.


METHOD Z2UI5_set_data.
METHOD z2ui5_set_data.

t_tab = VALUE #(
( title = 'row_01' info = 'completed' descr = 'this is a description' icon = 'sap-icon://account' )
Expand All @@ -184,15 +193,16 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
( text = `Info` key = `info` )
( text = `Description` key = `descr` ) ).

t_tab_filter_title = VALUE #(
( text = `Info` key = `Completed` )
( text = `Info` key = `Incompleted` ) ).
t_tab_filter = VALUE #(
( text = `Title` key = `Title` )
( text = `Descr` key = `Descr` )
( text = `Info` key = `Info` ) ).


ENDMETHOD.


METHOD Z2UI5_view_display.
METHOD z2ui5_view_display.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell(
Expand Down Expand Up @@ -241,14 +251,14 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
ENDMETHOD.


METHOD Z2UI5_view_filter_popup.
METHOD z2ui5_view_filter_popup.

DATA(popup_filter) = Z2UI5_cl_xml_view=>factory_popup( ).
DATA(popup_filter) = z2ui5_cl_xml_view=>factory_popup( ).

DATA(filter_view) = popup_filter->view_settings_dialog( filteritems = client->_bind_edit( t_tab_filter_title )
DATA(filter_view) = popup_filter->view_settings_dialog( filteritems = client->_bind_edit( t_tab_filter )
confirm = client->_event( val = `CONFIRM_FILTER` t_arg = VALUE #( ( `${$parameters>/filterString}` ) ) )
)->filter_items(
)->view_settings_filter_item( text = `Info` key = `INFO` multiselect = abap_true
)->view_settings_filter_item( multiselect = abap_true text = `{TEXT}` key = `{KEY}`
)->items(
)->view_settings_item( text = `{TEXT}` key = `{KEY}` )->get_parent(
* )->view_settings_item( text = `Completed` key = `Completed` )->get_parent(
Expand All @@ -261,15 +271,14 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
ENDMETHOD.


METHOD Z2UI5_view_group_popup.
METHOD z2ui5_view_group_popup.

DATA(popup_group) = Z2UI5_cl_xml_view=>factory_popup( ).
DATA(popup_group) = z2ui5_cl_xml_view=>factory_popup( ).

DATA(group_view) = popup_group->view_settings_dialog( confirm = client->_event( val = `CONFIRM_GROUP` t_arg = VALUE #( ( `${$parameters>/groupItem/mProperties/key}` ) ) )
reset = client->_event( `RESET_GROUP` )
groupdescending = client->_bind_edit( mv_group_descending )
groupitems = client->_bind_edit( t_tab_group )
filteritems = client->_bind_edit( t_tab_filter_title )
)->group_items(
)->view_settings_item( text = `{TEXT}` key = `{KEY}` selected = `{SELECTED}`
).
Expand All @@ -279,19 +288,20 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
ENDMETHOD.


METHOD Z2UI5_view_settings_popup.
DATA(popup_settings) = Z2UI5_cl_xml_view=>factory_popup( ).
METHOD z2ui5_view_settings_popup.
DATA(popup_settings) = z2ui5_cl_xml_view=>factory_popup( ).

popup_settings = popup_settings->view_settings_dialog(
confirm = client->_event( 'ALL_EVENT' )
sortitems = client->_bind_edit( t_tab_sort )
groupitems = client->_bind_edit( t_tab_group )
filteritems = client->_bind_edit( t_tab_filter )
)->sort_items(
)->view_settings_item( text = `{TEXT}` key = `{KEY}` selected = `{SELECTED}` )->get_parent( )->get_parent(
)->group_items(
)->view_settings_item( text = `{TEXT}` key = `{KEY}` selected = `{SELECTED}` )->get_parent( )->get_parent(
)->filter_items(
)->view_settings_filter_item( text = `Info` key = `INFO` multiselect = abap_true
)->view_settings_filter_item( text = `{TEXT}` key = `{KEY}` multiselect = abap_true
)->items(
)->view_settings_item( text = `{TEXT}` key = `{KEY}` ).

Expand All @@ -300,9 +310,9 @@ CLASS Z2UI5_CL_DEMO_APP_099 IMPLEMENTATION.
ENDMETHOD.


METHOD Z2UI5_view_sort_popup.
METHOD z2ui5_view_sort_popup.

DATA(popup_sort) = Z2UI5_cl_xml_view=>factory_popup( ).
DATA(popup_sort) = z2ui5_cl_xml_view=>factory_popup( ).

DATA(sort_view) = popup_sort->view_settings_dialog(
confirm = client->_event( val = `CONFIRM_SORT` t_arg = VALUE #( ( `${$parameters>/sortItem/mProperties/key}` ) ) )
Expand Down
2 changes: 1 addition & 1 deletion src/z2ui5_cl_demo_app_099.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_099</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>ui table</DESCRIPT>
<DESCRIPT>view setting dialog</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
Expand Down
3 changes: 3 additions & 0 deletions src/z2ui5_cl_demo_app_106.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ CLASS Z2UI5_CL_DEMO_APP_106 IMPLEMENTATION.

DATA(view) = z2ui5_cl_xml_view=>factory( ).

view->_generic( ns = `html` name = `style` )->_cc_plain_xml( `.tox-silver-sink { position: absolute !important; }` ).

view->shell(
)->page(
title = 'abap2UI5 - Rich Text Editor'
Expand All @@ -45,6 +47,7 @@ CLASS Z2UI5_CL_DEMO_APP_106 IMPLEMENTATION.
showGroupFont = abap_true
showGroupLink = abap_true
showGroupInsert = abap_true
wrapping = abap_false
)->get_parent( )->get_parent( )->get_parent(
)->footer(
)->overflow_toolbar(
Expand Down

0 comments on commit d35977a

Please sign in to comment.