-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
CLASS z2ui5_cl_demo_app_180 DEFINITION | ||
PUBLIC | ||
CREATE PUBLIC . | ||
|
||
PUBLIC SECTION. | ||
|
||
INTERFACES if_serializable_object . | ||
INTERFACES z2ui5_if_app . | ||
|
||
DATA mv_initialized TYPE abap_bool. | ||
DATA mv_url TYPE string. | ||
|
||
METHODS on_event. | ||
METHODS view_display. | ||
|
||
PROTECTED SECTION. | ||
|
||
DATA client TYPE REF TO z2ui5_if_client. | ||
|
||
PRIVATE SECTION. | ||
ENDCLASS. | ||
|
||
|
||
|
||
CLASS Z2UI5_CL_DEMO_APP_180 IMPLEMENTATION. | ||
|
||
|
||
METHOD on_event. | ||
|
||
CASE client->get( )-event. | ||
|
||
WHEN 'CUSTOM_JS_FROM_EB'. | ||
|
||
client->follow_up_action( custom_js = `sap.z2ui5.afterBE()` ). | ||
|
||
WHEN 'CALL_EF'. | ||
|
||
mv_url = `https://www.google.com`. | ||
|
||
client->view_model_update( ). | ||
|
||
client->follow_up_action( custom_js = client->_event_client( val = client->cs_event-open_new_tab t_arg = VALUE #( ( mv_url ) ) ) ). | ||
|
||
WHEN 'BACK'. | ||
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). | ||
RETURN. | ||
ENDCASE. | ||
|
||
ENDMETHOD. | ||
|
||
|
||
METHOD view_display. | ||
|
||
DATA(view) = z2ui5_cl_xml_view=>factory( ). | ||
view->_generic( name = `script` ns = `html` )->_cc_plain_xml( `sap.z2ui5.afterBE = () => { alert("afterBE triggered !!"); }` ). | ||
|
||
DATA(page) = view->shell( )->page( title = `Client->FOLLOW_UP_ACTION use cases` class = `sapUiContentPadding` ). | ||
page = page->vbox( ). | ||
page->button( text = `call frontend event from backend event` press = client->_event( `CALL_EF` ) ). | ||
page->label( text = `MV_URL was set AFTER backend event and model update to:` ). | ||
page->label( text = client->_bind_edit( mv_url ) ). | ||
|
||
page->get_parent( )->hbox( class = `sapUiSmallMargin` ). | ||
* page = page->vbox( ). | ||
page->button( text = `call custom JS from EB` press = client->_event( 'CUSTOM_JS_FROM_EB' ) ). | ||
|
||
|
||
client->view_display( view->stringify( ) ). | ||
|
||
ENDMETHOD. | ||
|
||
|
||
METHOD z2ui5_if_app~main. | ||
|
||
me->client = client. | ||
|
||
IF mv_initialized = abap_false. | ||
mv_initialized = abap_true. | ||
|
||
view_display( ). | ||
|
||
ENDIF. | ||
|
||
on_event( ). | ||
|
||
ENDMETHOD. | ||
ENDCLASS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_180</CLSNAME> | ||
<LANGU>E</LANGU> | ||
<DESCRIPT>follow_up_action</DESCRIPT> | ||
<STATE>1</STATE> | ||
<CLSCCINCL>X</CLSCCINCL> | ||
<FIXPT>X</FIXPT> | ||
<UNICODE>X</UNICODE> | ||
</VSEOCLASS> | ||
</asx:values> | ||
</asx:abap> | ||
</abapGit> |