mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 20:16:24 +08:00
parent
839db53f1f
commit
be43292f04
|
@ -138,7 +138,7 @@ CLASS Z2UI5_CL_APP_DEMO_05 IMPLEMENTATION.
|
||||||
|
|
||||||
DATA(grid) = page->grid( 'L12 M12 S12' )->content( 'layout' ).
|
DATA(grid) = page->grid( 'L12 M12 S12' )->content( 'layout' ).
|
||||||
|
|
||||||
grid->simple_form( 'More Controls' )->content( 'form'
|
grid->simple_form( title = 'More Controls' editable = abap_true )->content( 'form'
|
||||||
)->label( 'ProgressIndicator'
|
)->label( 'ProgressIndicator'
|
||||||
)->progress_indicator(
|
)->progress_indicator(
|
||||||
percentvalue = screen-progress_value
|
percentvalue = screen-progress_value
|
||||||
|
@ -169,7 +169,7 @@ CLASS Z2UI5_CL_APP_DEMO_05 IMPLEMENTATION.
|
||||||
class = 'sapUiTinyMargin'
|
class = 'sapUiTinyMargin'
|
||||||
)->label( 'MultiInput'
|
)->label( 'MultiInput'
|
||||||
)->multi_input(
|
)->multi_input(
|
||||||
tokens = client->_bind( mt_token )
|
tokens = client->_bind( mt_token )
|
||||||
showclearicon = abap_true
|
showclearicon = abap_true
|
||||||
showvaluehelp = abap_true
|
showvaluehelp = abap_true
|
||||||
suggestionitems = client->_bind( mt_token_sugg )
|
suggestionitems = client->_bind( mt_token_sugg )
|
||||||
|
@ -184,7 +184,7 @@ CLASS Z2UI5_CL_APP_DEMO_05 IMPLEMENTATION.
|
||||||
visible = `{VISIBLE}`
|
visible = `{VISIBLE}`
|
||||||
).
|
).
|
||||||
|
|
||||||
grid->simple_form( 'Text Area' )->content( 'form'
|
grid->simple_form( title = 'Text Area' editable = abap_true )->content( 'form'
|
||||||
)->label( 'text area'
|
)->label( 'text area'
|
||||||
)->text_area(
|
)->text_area(
|
||||||
value = `Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magn` &&
|
value = `Lorem ipsum dolor st amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magn` &&
|
||||||
|
|
|
@ -45,10 +45,18 @@ CLASS z2ui5_cl_app_demo_49 DEFINITION PUBLIC.
|
||||||
END OF ty_S_cols.
|
END OF ty_S_cols.
|
||||||
|
|
||||||
TYPES:
|
TYPES:
|
||||||
BEGIN OF ty_S_filter,
|
BEGIN OF ty_S_filter_show,
|
||||||
selkz TYPE abap_bool,
|
selkz TYPE abap_bool,
|
||||||
name TYPE string,
|
name TYPE string,
|
||||||
value TYPE string,
|
value TYPE string,
|
||||||
|
" t_value TYPE STANDARD TABLE OF ty_S_token WITH EMPTY KEY,
|
||||||
|
END OF ty_S_filter_show.
|
||||||
|
|
||||||
|
TYPES:
|
||||||
|
BEGIN OF ty_S_filter,
|
||||||
|
uuid TYPE string,
|
||||||
|
uuid_prev TYPE string,
|
||||||
|
"STANDARD TABLE OF ty_s_token WITH EMPTY KEY,
|
||||||
END OF ty_S_filter.
|
END OF ty_S_filter.
|
||||||
|
|
||||||
TYPES:
|
TYPES:
|
||||||
|
@ -66,7 +74,8 @@ CLASS z2ui5_cl_app_demo_49 DEFINITION PUBLIC.
|
||||||
title TYPE string,
|
title TYPE string,
|
||||||
sticky_header TYPE string,
|
sticky_header TYPE string,
|
||||||
selmode TYPE string,
|
selmode TYPE string,
|
||||||
t_filter TYPE STANDARD TABLE OF ty_S_filter,
|
t_filter_show TYPE STANDARD TABLE OF ty_S_filter_show,
|
||||||
|
s_filter TYPE ty_s_filter,
|
||||||
t_cols TYPE STANDARD TABLE OF ty_S_cols,
|
t_cols TYPE STANDARD TABLE OF ty_S_cols,
|
||||||
t_sort TYPE STANDARD TABLE OF ty_S_sort,
|
t_sort TYPE STANDARD TABLE OF ty_S_sort,
|
||||||
END OF ms_layout.
|
END OF ms_layout.
|
||||||
|
@ -125,6 +134,10 @@ CLASS z2ui5_cl_app_demo_49 DEFINITION PUBLIC.
|
||||||
METHODS z2ui5_set_search.
|
METHODS z2ui5_set_search.
|
||||||
METHODS z2ui5_set_detail.
|
METHODS z2ui5_set_detail.
|
||||||
METHODS z2ui5_set_sort.
|
METHODS z2ui5_set_sort.
|
||||||
|
METHODS z2ui5_set_filter
|
||||||
|
IMPORTING
|
||||||
|
io_box TYPE REF TO z2ui5_cl_xml_view.
|
||||||
|
METHODS z2ui5_set_data.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
@ -176,12 +189,7 @@ CLASS z2ui5_cl_app_demo_49 IMPLEMENTATION.
|
||||||
client->popup_message_box( `custom action called` ).
|
client->popup_message_box( `custom action called` ).
|
||||||
|
|
||||||
WHEN 'BUTTON_START'.
|
WHEN 'BUTTON_START'.
|
||||||
|
z2ui5_set_data( ).
|
||||||
SELECT FROM z2ui5_t_draft
|
|
||||||
FIELDS uuid, uuid_prev, timestampl, uname
|
|
||||||
INTO CORRESPONDING FIELDS OF TABLE @mt_table
|
|
||||||
UP TO 50 ROWS.
|
|
||||||
ms_view-t_tab = CORRESPONDING #( mt_table ).
|
|
||||||
|
|
||||||
WHEN 'BUTTON_DOWNLOAD'.
|
WHEN 'BUTTON_DOWNLOAD'.
|
||||||
mv_check_download_csv = abap_true.
|
mv_check_download_csv = abap_true.
|
||||||
|
@ -295,7 +303,7 @@ CLASS z2ui5_cl_app_demo_49 IMPLEMENTATION.
|
||||||
|
|
||||||
INSERT VALUE #(
|
INSERT VALUE #(
|
||||||
name = lr_col->*
|
name = lr_col->*
|
||||||
) INTO TABLE ms_layout-t_filter.
|
) INTO TABLE ms_layout-t_filter_show.
|
||||||
|
|
||||||
INSERT VALUE #(
|
INSERT VALUE #(
|
||||||
visible = abap_true
|
visible = abap_true
|
||||||
|
@ -355,24 +363,13 @@ CLASS z2ui5_cl_app_demo_49 IMPLEMENTATION.
|
||||||
|
|
||||||
header_title->actions( ns = 'f' )->overflow_toolbar(
|
header_title->actions( ns = 'f' )->overflow_toolbar(
|
||||||
)->button( text = `Layout` type = `Emphasized` press = client->_event( `POPUP_LAYOUT` )
|
)->button( text = `Layout` type = `Emphasized` press = client->_event( `POPUP_LAYOUT` )
|
||||||
)->button( text = `Start` press = client->_event( `BUTTON_START` ) type = `Emphasized`
|
|
||||||
).
|
).
|
||||||
|
|
||||||
DATA(lo_box) = page->header( )->dynamic_page_header( pinnable = abap_true
|
DATA(lo_box) = page->header( )->dynamic_page_header( pinnable = abap_true
|
||||||
)->flex_box( alignItems = `Start` justifyContent = `SpaceBetween` ).
|
)->flex_box( alignitems = `Start` justifycontent = `SpaceBetween` )->flex_box( alignItems = `Start` ).
|
||||||
|
|
||||||
|
|
||||||
DATA(lt_filter) = ms_layout-t_filter.
|
|
||||||
DELETE lt_filter WHERE selkz = abap_false.
|
|
||||||
|
|
||||||
LOOP AT lt_filter REFERENCE INTO DATA(lr_filter)
|
|
||||||
WHERE selkz = abap_true.
|
|
||||||
lo_box->input( description = lr_filter->name ).
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
|
|
||||||
lo_box->button( text = `Change Filter (` && shift_right( CONV string( lines( lt_filter ) ) ) && `)` press = client->_event( `POPUP_FILTER` ) ).
|
|
||||||
|
|
||||||
|
z2ui5_set_filter( lo_box ).
|
||||||
|
|
||||||
|
|
||||||
DATA(cont) = page->content( ns = 'f' ).
|
DATA(cont) = page->content( ns = 'f' ).
|
||||||
|
@ -655,7 +652,7 @@ CLASS z2ui5_cl_app_demo_49 IMPLEMENTATION.
|
||||||
lo_popup->dialog( 'abap2UI5 - Popup to select entry'
|
lo_popup->dialog( 'abap2UI5 - Popup to select entry'
|
||||||
)->table(
|
)->table(
|
||||||
mode = 'MultiSelect'
|
mode = 'MultiSelect'
|
||||||
items = client->_bind( ms_layout-t_filter )
|
items = client->_bind( ms_layout-t_filter_show )
|
||||||
)->columns(
|
)->columns(
|
||||||
)->column( )->text( 'Title' )->get_parent(
|
)->column( )->text( 'Title' )->get_parent(
|
||||||
)->column( )->text( 'Color' )->get_parent(
|
)->column( )->text( 'Color' )->get_parent(
|
||||||
|
@ -841,4 +838,53 @@ CLASS z2ui5_cl_app_demo_49 IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD z2ui5_set_filter.
|
||||||
|
|
||||||
|
IF line_exists( ms_layout-t_filter_show[ name = `UUID` selkz = abap_true ] ).
|
||||||
|
io_box->input( value = client->_bind( ms_layout-s_filter-uuid ) description = `UUID` ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
IF line_exists( ms_layout-t_filter_show[ name = `UUID_PREV` selkz = abap_true ] ).
|
||||||
|
io_box->input( value = client->_bind( ms_layout-s_filter-uuid_prev ) description = `UUID_PREV` ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
"todo other columns...
|
||||||
|
|
||||||
|
DATA(rt_filter) = ms_layout-t_filter_show.
|
||||||
|
DELETE rt_filter WHERE selkz = abap_false.
|
||||||
|
|
||||||
|
io_box->get_parent( )->hbox( justifycontent = `End`
|
||||||
|
)->button( text = `Change Filter (` && shift_right( CONV string( lines( rt_filter ) ) ) && `)` press = client->_event( `POPUP_FILTER` )
|
||||||
|
)->button( text = `Start` press = client->_event( `BUTTON_START` ) type = `Emphasized` ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD z2ui5_set_data.
|
||||||
|
|
||||||
|
"dirty solution
|
||||||
|
"todo: map filters to rangetab and make a nice select
|
||||||
|
|
||||||
|
IF ms_layout-s_filter-uuid IS INITIAL.
|
||||||
|
|
||||||
|
SELECT FROM z2ui5_t_draft
|
||||||
|
FIELDS uuid, uuid_prev, timestampl, uname
|
||||||
|
INTO CORRESPONDING FIELDS OF TABLE @mt_table
|
||||||
|
UP TO 50 ROWS.
|
||||||
|
|
||||||
|
ELSE.
|
||||||
|
|
||||||
|
SELECT FROM z2ui5_t_draft
|
||||||
|
FIELDS uuid, uuid_prev, timestampl, uname
|
||||||
|
WHERE uuid = @ms_layout-s_filter-uuid
|
||||||
|
INTO CORRESPONDING FIELDS OF TABLE @mt_table
|
||||||
|
UP TO 50 ROWS.
|
||||||
|
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ms_view-t_tab = CORRESPONDING #( mt_table ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -607,7 +607,8 @@ CLASS z2ui5_cl_xml_view DEFINITION
|
||||||
|
|
||||||
METHODS hbox
|
METHODS hbox
|
||||||
IMPORTING
|
IMPORTING
|
||||||
class TYPE clike OPTIONAL
|
class TYPE clike OPTIONAL
|
||||||
|
justifycontent TYPE clike OPTIONAL
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
|
||||||
|
|
||||||
|
@ -1396,6 +1397,7 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
|
||||||
name = `HBox`
|
name = `HBox`
|
||||||
t_prop = VALUE #(
|
t_prop = VALUE #(
|
||||||
( n = `class` v = class )
|
( n = `class` v = class )
|
||||||
|
( n = `justifyContent` v = justifycontent )
|
||||||
) ).
|
) ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
|
@ -89,7 +89,7 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
IF content_security_policy IS NOT SUPPLIED.
|
IF content_security_policy IS NOT SUPPLIED.
|
||||||
DATA(lv_sec_policy) = `<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval' ui5.sap.com *.ui5.sap.com sdk.openui5.org *.sdk.openui5.org cdn.jsdelivr.net *.cdn.jsdelivr.net"/>`.
|
DATA(lv_sec_policy) = `<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval' data: ui5.sap.com *.ui5.sap.com sdk.openui5.org *.sdk.openui5.org cdn.jsdelivr.net *.cdn.jsdelivr.net"/>`.
|
||||||
ELSE.
|
ELSE.
|
||||||
lv_sec_policy = content_security_policy.
|
lv_sec_policy = content_security_policy.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user