-
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.
Added Demo for SmartMultiInput feature (#463)
* SmartMultiInput Demo * Update z2ui5_cl_demo_app_319.clas.abap --------- Co-authored-by: oblomov-dev <[email protected]>
- Loading branch information
1 parent
fd69b71
commit c56ff1a
Showing
2 changed files
with
110 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,94 @@ | ||
CLASS z2ui5_cl_demo_app_319 DEFINITION PUBLIC. | ||
|
||
PUBLIC SECTION. | ||
INTERFACES z2ui5_if_app. | ||
|
||
TYPES: | ||
BEGIN OF t_token, | ||
key TYPE string, | ||
text TYPE string, | ||
END OF t_token, | ||
t_tokens TYPE STANDARD TABLE OF t_token WITH EMPTY KEY. | ||
TYPES: | ||
BEGIN OF t_range, | ||
exclude TYPE boole_d, | ||
operation TYPE string, | ||
value1 TYPE string, | ||
value2 TYPE string, | ||
keyField TYPE string, | ||
END OF t_range, | ||
t_ranges TYPE STANDARD TABLE OF t_range WITH EMPTY KEY. | ||
DATA: | ||
BEGIN OF m_selection, | ||
BEGIN OF product_type, | ||
tokens_added TYPE t_tokens, | ||
tokens_removed TYPE t_tokens, | ||
ranges TYPE t_ranges, | ||
END OF product_type, | ||
END OF m_selection. | ||
PROTECTED SECTION. | ||
DATA m_client TYPE REF TO z2ui5_if_client. | ||
METHODS on_init. | ||
METHODS on_event. | ||
ENDCLASS. | ||
|
||
CLASS z2ui5_cl_demo_app_319 IMPLEMENTATION. | ||
|
||
METHOD z2ui5_if_app~main. | ||
|
||
m_client = client. | ||
|
||
IF m_client->check_on_init( ). | ||
on_init( ). | ||
RETURN. | ||
ENDIF. | ||
|
||
on_event( ). | ||
|
||
ENDMETHOD. | ||
|
||
METHOD on_init. | ||
|
||
DATA(l_view) = z2ui5_cl_xml_view=>factory( ). | ||
|
||
DATA(l_page) = l_view->shell( appwidthlimited = 'false' )->page( | ||
id = 'SearchPage' | ||
title = TEXT-001 | ||
shownavbutton = abap_false | ||
showheader = abap_true ). | ||
|
||
l_page->_z2ui5( )->smartmultiinput_ext( | ||
addedtokens = m_client->_bind_edit( val = m_selection-product_type-tokens_added switch_default_model = abap_true ) | ||
removedtokens = m_client->_bind_edit( val = m_selection-product_type-tokens_removed switch_default_model = abap_true ) | ||
rangeData = m_client->_bind_edit( val = m_selection-product_type-ranges switch_default_model = abap_true ) | ||
change = m_client->_event( 'PRODTYPE_CHANGED' ) | ||
multiinputid = `ProductTypeMultiInput` ). | ||
|
||
l_page->smart_multi_input( | ||
id = 'ProductTypeMultiInput' | ||
value = '{ProductType}' | ||
entityset = 'ProductList' | ||
supportranges = 'true' | ||
enableodataselect = 'true' ). | ||
|
||
m_client->view_display( val = l_page->stringify( ) | ||
switch_default_model_path = `/sap/opu/odata/sap/UI_PRODUCTLIST` | ||
switchdefaultmodelannouri = `/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations(TechnicalName='UI_PRODUCTLIST_VAN',Version='0001')/$value` ). | ||
|
||
ENDMETHOD. | ||
|
||
METHOD on_event. | ||
|
||
CASE m_client->get( )-event. | ||
WHEN 'PRODTYPE_CHANGED'. | ||
TRY. | ||
m_client->message_box_display( | ||
text = z2ui5_cl_ajson=>new( )->set( iv_path = '/' iv_val = m_selection-product_type-ranges )->stringify( ) | ||
title = 'range content' ). | ||
CATCH z2ui5_cx_ajson_error INTO DATA(lx_ajson). | ||
m_client->message_toast_display( lx_ajson->get_text( ) ). | ||
ENDTRY. | ||
ENDCASE. | ||
|
||
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_319</CLSNAME> | ||
<LANGU>E</LANGU> | ||
<DESCRIPT>odata, smartmultiinput</DESCRIPT> | ||
<STATE>1</STATE> | ||
<CLSCCINCL>X</CLSCCINCL> | ||
<FIXPT>X</FIXPT> | ||
<UNICODE>X</UNICODE> | ||
</VSEOCLASS> | ||
</asx:values> | ||
</asx:abap> | ||
</abapGit> |