|
| 1 | +CLASS z2ui5_cl_demo_app_313 DEFINITION PUBLIC. |
| 2 | + |
| 3 | + PUBLIC SECTION. |
| 4 | + |
| 5 | + INTERFACES z2ui5_if_app. |
| 6 | + |
| 7 | + TYPES: |
| 8 | + BEGIN OF ty_row, |
| 9 | + count TYPE i, |
| 10 | + value TYPE string, |
| 11 | + descr TYPE string, |
| 12 | + icon TYPE string, |
| 13 | + info TYPE string, |
| 14 | + checkbox TYPE abap_bool, |
| 15 | + percentage TYPE p LENGTH 5 DECIMALS 2, |
| 16 | + valuecolor TYPE string, |
| 17 | + END OF ty_row. |
| 18 | + |
| 19 | + DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY. |
| 20 | + DATA check_initialized TYPE abap_bool. |
| 21 | + DATA check_ui5 TYPE abap_bool. |
| 22 | + DATA mv_key TYPE string. |
| 23 | + |
| 24 | + PROTECTED SECTION. |
| 25 | + PRIVATE SECTION. |
| 26 | +ENDCLASS. |
| 27 | + |
| 28 | + |
| 29 | +CLASS z2ui5_cl_demo_app_313 IMPLEMENTATION. |
| 30 | + |
| 31 | + |
| 32 | + METHOD z2ui5_if_app~main. |
| 33 | + |
| 34 | + IF client->check_on_init( ). |
| 35 | + |
| 36 | + DATA(view) = z2ui5_cl_xml_view=>factory( ). |
| 37 | + |
| 38 | + DATA(page) = view->shell( |
| 39 | + )->page( |
| 40 | + title = 'abap2UI5 - Smart Controls with Variants' |
| 41 | + navbuttonpress = client->_event( 'BACK' ) |
| 42 | + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). |
| 43 | + |
| 44 | + |
| 45 | + page->smart_filter_bar( |
| 46 | + id = 'smartFilterBar' |
| 47 | + persistencykey = 'SmartFilterPKey' |
| 48 | + entityset = 'BookingSupplement' |
| 49 | + )->_control_configuration( |
| 50 | + )->control_configuration( |
| 51 | + previnitdatafetchinvalhelpdia = abap_false |
| 52 | + visibleinadvancedarea = abap_true |
| 53 | + key = 'TravelID' |
| 54 | + )->get_parent( |
| 55 | + )->smart_table( |
| 56 | + id = 'smartTable_ResponsiveTable' |
| 57 | + smartfilterid = 'smartFilterBar' |
| 58 | + tabletype = 'ResponsiveTable' |
| 59 | + editable = abap_false |
| 60 | + initiallyvisiblefields = 'TravelID,BookingID' |
| 61 | + entityset = 'BookingSupplement' |
| 62 | + usevariantmanagement = abap_true |
| 63 | + useexporttoexcel = abap_true |
| 64 | + usetablepersonalisation = abap_true |
| 65 | + header = 'Test' |
| 66 | + showrowcount = abap_true |
| 67 | + enableexport = abap_false |
| 68 | + enableautobinding = abap_true |
| 69 | + ). |
| 70 | + |
| 71 | +* page->_cc_plain_xml( ` <smartFilterBar:SmartFilterBar ` && |\n| && |
| 72 | +* ` id="smartFilterBar"` && |\n| && |
| 73 | +* ` entitySet="BookingSupplement" persistencyKey="SmartFilterPKey" >` && |\n| && |
| 74 | +* ` <smartFilterBar:controlConfiguration>` && |\n| && |
| 75 | +* ` <smartFilterBar:ControlConfiguration` && |\n| && |
| 76 | +* ` key="TravelID" visibleInAdvancedArea="true"` && |\n| && |
| 77 | +* ` preventInitialDataFetchInValueHelpDialog="false">` && |\n| && |
| 78 | +* ` </smartFilterBar:ControlConfiguration>` && |\n| && |
| 79 | +* ` </smartFilterBar:controlConfiguration>` && |\n| && |
| 80 | +* ` </smartFilterBar:SmartFilterBar> <smartTable:SmartTable ` && |\n| && |
| 81 | +* ` id="smartTable_ResponsiveTable"` && |\n| && |
| 82 | +* ` smartFilterId="smartFilterBar" ` && |\n| && |
| 83 | +* ` tableType="ResponsiveTable" ` && |\n| && |
| 84 | +* ` editable="false"` && |\n| && |
| 85 | +* ` initiallyVisibleFields="TravelID,BookingID"` && |\n| && |
| 86 | +* ` entitySet="BookingSupplement" ` && |\n| && |
| 87 | +* ` useVariantManagement="true"` && |\n| && |
| 88 | +* ` useExportToExcel="true"` && |\n| && |
| 89 | +* ` useTablePersonalisation="true" ` && |\n| && |
| 90 | +* ` header="Test" ` && |\n| && |
| 91 | +* ` showRowCount="true"` && |\n| && |
| 92 | +* ` enableExport="false" ` && |\n| && |
| 93 | +* ` enableAutoBinding="true">` && |\n| && |
| 94 | +* `</smartTable:SmartTable>` ). |
| 95 | +** ` <smartForm:SmartForm editable="true">` && |\n| && |
| 96 | +* ` <smartForm:layout>` && |\n| && |
| 97 | +* ` <smartForm:ColumnLayout ` && |\n| && |
| 98 | +* ` emptyCellsLarge="4"` && |\n| && |
| 99 | +* ` labelCellsLarge="4"` && |\n| && |
| 100 | +* ` columnsM="1"` && |\n| && |
| 101 | +* ` columnsL="1"` && |\n| && |
| 102 | +* ` columnsXL="1"/>` && |\n| && |
| 103 | +* ` </smartForm:layout>` && |\n| && |
| 104 | +* ` <smartForm:Group>` && |\n| && |
| 105 | +* ` <smartForm:GroupElement>` && |\n| && |
| 106 | +* ` <smartField:SmartField value="{City}" id="idPrice"/>` && |\n| && |
| 107 | +* ` </smartForm:GroupElement>` && |\n| && |
| 108 | +* ` </smartForm:Group>` && |\n| && |
| 109 | +* ` </smartForm:SmartForm>` ). |
| 110 | + |
| 111 | + client->view_display( val = view->stringify( ) switchdefaultmodel = abap_true ). |
| 112 | + ENDIF. |
| 113 | + |
| 114 | + CASE client->get( )-event. |
| 115 | + WHEN 'BACK'. |
| 116 | + client->nav_app_leave( ). |
| 117 | + ENDCASE. |
| 118 | + |
| 119 | + ENDMETHOD. |
| 120 | +ENDCLASS. |
0 commit comments