File tree Expand file tree Collapse file tree 5 files changed +86
-3
lines changed Expand file tree Collapse file tree 5 files changed +86
-3
lines changed Original file line number Diff line number Diff line change @@ -1994,6 +1994,13 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
19941994 class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
19951995 ).
19961996
1997+ panel->generic_tile( header = 'Share Button'
1998+ subheader = ``
1999+ press = client->_event( 'z2ui5_cl_demo_app_323' )
2000+ mode = 'LineMode'
2001+ class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
2002+ ).
2003+
19972004 panel->generic_tile( header = 'History'
19982005 subheader = ``
19992006 press = client->_event( 'z2ui5_cl_demo_app_322' )
Original file line number Diff line number Diff line change @@ -30,8 +30,11 @@ CLASS z2ui5_cl_demo_app_321 IMPLEMENTATION.
3030 )->label( 'quantity'
3131 )->input( client->_bind_edit( mv_quantity )
3232 )->button(
33- text = 'post'
33+ text = 'post with state '
3434 press = client->_event( val = 'BUTTON_POST' )
35+ )->button(
36+ text = 'post'
37+ press = client->_event( val = 'BUTTON_POST2' )
3538 )->stringify( ) ).
3639 ENDIF .
3740
@@ -41,6 +44,10 @@ CLASS z2ui5_cl_demo_app_321 IMPLEMENTATION.
4144 client->message_toast_display( `data updated` ).
4245 "this is where the magic happens...
4346 client->set_app_state_active( ).
47+ WHEN `BUTTON_POST2` .
48+ client->message_toast_display( `data updated` ).
49+ "this is where the magic happens...
50+ * client->set_app_state_active( ).
4451 WHEN `BACK` .
4552 client->nav_app_leave( ).
4653 ENDCASE .
Original file line number Diff line number Diff line change @@ -37,13 +37,15 @@ CLASS z2ui5_cl_demo_app_322 IMPLEMENTATION.
3737 press = client->_event_client( 'HISTORY_BACK' )
3838 )->stringify( ) ).
3939
40- client->set_push_state( ).
40+ IF client->check_app_prev_stack( ).
41+ client->set_push_state( `/head/pos/` && client->get( )-s_draft-id ).
42+ ENDIF .
4143 RETURN .
4244 ENDIF .
4345
4446 CASE client->get( )-event.
4547 WHEN 'BUTTON_POST' .
46- client->set_push_state( ).
48+ client->set_push_state( `/head/pos/` && client->get( )-s_draft-id ).
4749 ENDCASE .
4850 client->message_toast_display( `data updated` ).
4951
Original file line number Diff line number Diff line change 1+ CLASS z2ui5_cl_demo_app_323 DEFINITION
2+ PUBLIC FINAL
3+ CREATE PUBLIC .
4+
5+ PUBLIC SECTION .
6+ INTERFACES z2ui5_if_app.
7+
8+ DATA mv_quantity TYPE string .
9+
10+ PROTECTED SECTION .
11+ PRIVATE SECTION .
12+
13+ ENDCLASS .
14+
15+
16+ CLASS z2ui5_cl_demo_app_323 IMPLEMENTATION .
17+
18+ METHOD z2ui5_if_app ~main .
19+
20+ IF client->check_on_navigated( ).
21+ DATA (view ) = z2ui5_cl_xml_view=>factory( ).
22+ client->view_display( val = view->shell(
23+ )->page(
24+ title = 'abap2UI5 - Navigation with app state'
25+ navbuttonpress = client->_event( 'BACK' )
26+ shownavbutton = client->check_app_prev_stack( )
27+ )->simple_form( title = 'Form Title' editable = abap_true
28+ )->content( 'form'
29+ )->title( 'Input'
30+ )->label( 'quantity'
31+ )->input( client->_bind_edit( mv_quantity )
32+ )->button(
33+ text = 'share'
34+ press = client->_event( val = 'BUTTON_POST' )
35+ )->stringify( ) ).
36+ ENDIF .
37+
38+ CASE client->get( )-event.
39+
40+ WHEN `BUTTON_POST` .
41+ client->follow_up_action( client->_event_client( z2ui5_if_client=>cs_event-CLIPBOARD_APP_STATE ) ).
42+ client->message_toast_display( `clipboard copied` ).
43+
44+ WHEN `BACK` .
45+ client->nav_app_leave( ).
46+ ENDCASE .
47+ ENDMETHOD .
48+
49+
50+
51+ ENDCLASS .
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <abapGit version =" v1.0.0" serializer =" LCL_OBJECT_CLAS" serializer_version =" v1.0.0" >
3+ <asx : abap xmlns : asx =" http://www.sap.com/abapxml" version =" 1.0" >
4+ <asx : values >
5+ <VSEOCLASS >
6+ <CLSNAME >Z2UI5_CL_DEMO_APP_323</CLSNAME >
7+ <LANGU >E</LANGU >
8+ <DESCRIPT >Navigation - app state share</DESCRIPT >
9+ <STATE >1</STATE >
10+ <CLSCCINCL >X</CLSCCINCL >
11+ <FIXPT >X</FIXPT >
12+ <UNICODE >X</UNICODE >
13+ </VSEOCLASS >
14+ </asx : values >
15+ </asx : abap >
16+ </abapGit >
You can’t perform that action at this time.
0 commit comments