Skip to content
Merged
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
71 changes: 71 additions & 0 deletions src/z2ui5_cl_demo_app_325.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
CLASS z2ui5_cl_demo_app_325 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES Z2UI5_if_app.
DATA input TYPE string.
DATA text TYPE string.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_demo_app_325 IMPLEMENTATION.

METHOD Z2UI5_if_app~main.

IF client->check_on_init( ).

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->object_page_layout(
showtitleinheadercontent = abap_true
showeditheaderbutton = abap_true
uppercaseanchorbar = abap_false ).

DATA(header_title) = page->header_title(
)->object_page_dyn_header_title( ).

header_title->expanded_heading( )->hbox( )->title( text = 'Test' wrapping = abap_true ).
header_title->snapped_heading( )->flex_box( alignitems = `Center` )->title( text = 'Test' wrapping = abap_true ).

DATA(sections) = page->sections( ).

sections->object_page_section( titleuppercase = abap_false id = 'id_sec1' title = '...' )->heading( ns = `uxap`
)->get_parent( )->sub_sections( )->object_page_sub_section( id = 'id_input' title = 'Input field'
)->blocks( )->vbox(
)->input( value = client->_bind_edit( input ) width = `50%`
)->button( text = 'Copy input' type = 'Emphasized' press = client->_event( 'COPY_INPUT' ) ).

sections->object_page_section( titleuppercase = abap_false id = 'id_sec2' title = '...' )->heading( ns = `uxap`
)->get_parent( )->sub_sections( )->object_page_sub_section( id = 'id_text_area' title = 'Text area'
)->blocks( )->vbox(
)->button( text = 'Copy text area' type = 'Emphasized' press = client->_event( 'COPY_TEXT_AREA' )
)->text_area( valueliveupdate = abap_true editable = abap_true value = client->_bind_edit( text ) growing = abap_true
growingmaxlines = '50' width = '100%' rows = '15' id = 'text_id' ).

client->view_display( page->stringify( ) ).

ENDIF.


CASE client->get( )-event.
WHEN 'COPY_INPUT'.
client->follow_up_action( client->_event_client(
val = z2ui5_if_client=>cs_event-clipboard_copy
t_arg = VALUE #( ( input ) ) ) ).
client->message_toast_display( `input field copied` && input ).

WHEN 'COPY_TEXT_AREA'.
client->follow_up_action( client->_event_client(
val = z2ui5_if_client=>cs_event-clipboard_copy
t_arg = VALUE #( ( text ) ) ) ).
client->message_toast_display( `text area copied: ` && text ).

ENDCASE.

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/z2ui5_cl_demo_app_325.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_325</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>clipboard feature</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>