Smart controls test (#1606)

* smart controls test

* update

* Update src/01/03/z2ui5_cl_app_view1_js.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* update

* update

* update

* update

* update

---------

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
This commit is contained in:
oblomov-dev 2024-12-02 12:13:51 +01:00 committed by GitHub
parent 062332d22b
commit 6416c41bca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 268 additions and 151 deletions

View File

@ -5,7 +5,8 @@ sap.ui.define(["sap/ui/core/mvc/Controller",
onInit: async function () { onInit: async function () {
z2ui5.oConfig.pathname = this.getView().getModel().sServiceUrl; z2ui5.oModel2 = this.getView().getModel("");
z2ui5.oConfig.pathname = this.getView().getModel("http").sServiceUrl;
if (z2ui5?.checkLocal == true ) { if (z2ui5?.checkLocal == true ) {
z2ui5.oConfig.pathname = window.location.href; z2ui5.oConfig.pathname = window.location.href;
}; };

View File

@ -241,6 +241,14 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
break; break;
} }
break; break;
case 'SET_ODATA_MODEL':
sap.ui.require([
"sap/ui/model/odata/v2/ODataModel"
], async (ODataModel) => {
var oModel = new ODataModel({ serviceUrl : args[1] });
z2ui5.oView.setModel( oModel , args[2] );
});
break;
case 'DOWNLOAD_B64_FILE': case 'DOWNLOAD_B64_FILE':
var a = document.createElement("a"); var a = document.createElement("a");
a.href = args[1]; a.href = args[1];
@ -337,11 +345,13 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
z2ui5.isBusy = true; z2ui5.isBusy = true;
BusyIndicator.show(); BusyIndicator.show();
z2ui5.oBody = {}; z2ui5.oBody = {};
if (args[0][3]) { if (args[0][3] || z2ui5.oController == this ) {
z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX; if (z2ui5.oResponse.PARAMS.S_VIEW?.SWITCHDEFAULTMODEL == true ){
z2ui5.oBody.VIEWNAME = 'MAIN'; var oModel = z2ui5.oView.getModel( "http");
} else if (z2ui5.oController == this) { }else{
z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX; oModel = z2ui5.oView.getModel();
}
z2ui5.oBody.XX = oModel.getData().XX;
z2ui5.oBody.VIEWNAME = 'MAIN'; z2ui5.oBody.VIEWNAME = 'MAIN';
} else if (z2ui5.oControllerPopup == this) { } else if (z2ui5.oControllerPopup == this) {
if (z2ui5.oViewPopup) { if (z2ui5.oViewPopup) {
@ -364,9 +374,6 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
} }
} }
) )
// if (args[0][1]) {
// z2ui5.oController.ViewDestroy();
// }
z2ui5.oBody.ID = z2ui5.oResponse.ID; z2ui5.oBody.ID = z2ui5.oResponse.ID;
z2ui5.oBody.ARGUMENTS = args; z2ui5.oBody.ARGUMENTS = args;
z2ui5.oBody.ARGUMENTS.forEach((item, i) => { z2ui5.oBody.ARGUMENTS.forEach((item, i) => {
@ -445,37 +452,6 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
}; };
if ( oParams.icon = 'None' ) { delete oParams.icon }; if ( oParams.icon = 'None' ) { delete oParams.icon };
MessageBox[params[msgType].TYPE](params[msgType].TEXT, oParams); MessageBox[params[msgType].TYPE](params[msgType].TEXT, oParams);
return;
switch (params[msgType].TYPE) {
case 'error':
MessageBox.error(params[msgType].TEXT, oParams);
break;
case 'warning':
MessageBox.error(params[msgType].TEXT, oParams);
break;
default:
MessageBox.shwo(params[msgType].TEXT, oParams);
break;
}
return;
if (params[msgType].TYPE) {
MessageBox[params[msgType].TYPE](params[msgType].TEXT);
} else {
MessageBox.show(params[msgType].TEXT, {
styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',
title: params[msgType].TITLE ? params[msgType].TITLE : '',
onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,
actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',
emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',
initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,
textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',
icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',
details: params[msgType].DETAILS ? params[msgType].DETAILS : '',
closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false
})
}
} }
} }
}, },
@ -484,9 +460,13 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
}, },
async displayView(xml, viewModel) { async displayView(xml, viewModel) {
let oview_model = new JSONModel(viewModel); let oview_model = new JSONModel(viewModel);
var oModel = oview_model;
if (z2ui5.oResponse.PARAMS.S_VIEW?.SWITCHDEFAULTMODEL == true){
oModel = z2ui5.oModel2;
}
z2ui5.oView = await XMLView.create({ z2ui5.oView = await XMLView.create({
definition: xml, definition: xml,
models: oview_model, models: oModel,
controller: z2ui5.oController, controller: z2ui5.oController,
id: 'mainView', id: 'mainView',
preprocessors: { preprocessors: {
@ -498,6 +478,9 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
} }
}); });
z2ui5.oView.setModel(z2ui5.oDeviceModel, "device"); z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");
if (z2ui5.oResponse.PARAMS.S_VIEW?.SWITCHDEFAULTMODEL == true){
z2ui5.oView.setModel(oview_model, "http");
}
this._oApp.removeAllPages(); this._oApp.removeAllPages();
this._oApp.insertPage(z2ui5.oView); this._oApp.insertPage(z2ui5.oView);
}, },

View File

@ -16,6 +16,15 @@
}, },
"dataSources": { "dataSources": {
"mainService": { "mainService": {
"uri": "/sap/opu/odata/DMO/API_TRAVEL_U_V2/",
"type": "OData",
"settings": {
"annotations": [],
"localUri": "localService/metadata.xml",
"odataVersion": "2.0"
}
},
"http": {
"uri": "/sap/bc/z2ui5", "uri": "/sap/bc/z2ui5",
"type": "OData", "type": "OData",
"settings": { "settings": {
@ -78,6 +87,11 @@
"dataSource": "mainService", "dataSource": "mainService",
"preload": true, "preload": true,
"settings": {} "settings": {}
},
"http": {
"dataSource": "http",
"preload": true,
"settings": {}
} }
}, },
"resources": { "resources": {

View File

@ -291,6 +291,7 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
METHOD z2ui5_if_client~view_display. METHOD z2ui5_if_client~view_display.
mo_action->ms_next-s_set-s_view-xml = val. mo_action->ms_next-s_set-s_view-xml = val.
mo_action->ms_next-s_set-s_view-switchDefaultModel = switchDefaultModel.
ENDMETHOD. ENDMETHOD.
@ -309,7 +310,10 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
custom_filter = custom_filter custom_filter = custom_filter
custom_mapper = custom_mapper custom_mapper = custom_mapper
tab = z2ui5_cl_util=>conv_get_as_data_ref( tab ) tab = z2ui5_cl_util=>conv_get_as_data_ref( tab )
tab_index = tab_index ) ). tab_index = tab_index
switchDefaultModel = switchDefaultModel ) ).
ENDMETHOD. ENDMETHOD.
@ -324,7 +328,8 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
custom_mapper = custom_mapper custom_mapper = custom_mapper
custom_mapper_back = custom_mapper_back custom_mapper_back = custom_mapper_back
tab = z2ui5_cl_util=>conv_get_as_data_ref( tab ) tab = z2ui5_cl_util=>conv_get_as_data_ref( tab )
tab_index = tab_index ) ). tab_index = tab_index
switchDefaultModel = switchDefaultModel ) ).
ENDMETHOD. ENDMETHOD.
@ -334,7 +339,8 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
result = lo_bind->main_local( val = val result = lo_bind->main_local( val = val
config = VALUE #( path_only = path config = VALUE #( path_only = path
custom_mapper = custom_mapper custom_mapper = custom_mapper
custom_filter = custom_filter ) ). custom_filter = custom_filter
switchDefaultModel = switchDefaultModel ) ).
ENDMETHOD. ENDMETHOD.
@ -365,7 +371,8 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
DATA(lv_check_sticky) = CAST z2ui5_if_app( mo_action->mo_app->mo_app )->check_sticky. DATA(lv_check_sticky) = CAST z2ui5_if_app( mo_action->mo_app->mo_app )->check_sticky.
IF lv_check_sticky = abap_true AND stateful = abap_true. IF lv_check_sticky = abap_true AND stateful = abap_true.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = `STATEFUL_ALREADY_ACTIVATED_ERROR`. EXPORTING
val = `STATEFUL_ALREADY_ACTIVATED_ERROR`.
ENDIF. ENDIF.
IF stateful = abap_true. IF stateful = abap_true.
mo_action->ms_next-s_set-s_stateful-active = 1. mo_action->ms_next-s_set-s_stateful-active = 1.

View File

@ -97,7 +97,8 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION.
IF mr_attri->bind_type <> mv_type. IF mr_attri->bind_type <> mv_type.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = |<p>Binding Error - Two different binding types for same attribute used ({ mr_attri->name }).|. EXPORTING
val = |<p>Binding Error - Two different binding types for same attribute used ({ mr_attri->name }).|.
ENDIF. ENDIF.
IF mr_attri->custom_mapper IS BOUND. IF mr_attri->custom_mapper IS BOUND.
@ -106,18 +107,21 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION.
DATA(lv_name2) = z2ui5_cl_util=>rtti_get_classname_by_ref( ms_config-custom_mapper ). DATA(lv_name2) = z2ui5_cl_util=>rtti_get_classname_by_ref( ms_config-custom_mapper ).
IF lv_name1 <> lv_name2. IF lv_name1 <> lv_name2.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = |<p>Binding Error - Two different mapper for same attribute used ({ mr_attri->name }).|. EXPORTING
val = |<p>Binding Error - Two different mapper for same attribute used ({ mr_attri->name }).|.
ENDIF. ENDIF.
ENDIF. ENDIF.
IF mr_attri->custom_mapper_back IS BOUND AND mr_attri->custom_mapper_back <> ms_config-custom_mapper_back. IF mr_attri->custom_mapper_back IS BOUND AND mr_attri->custom_mapper_back <> ms_config-custom_mapper_back.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = |<p>Binding Error - Two different mapper back for same attribute used ({ mr_attri->name }).|. EXPORTING
val = |<p>Binding Error - Two different mapper back for same attribute used ({ mr_attri->name }).|.
ENDIF. ENDIF.
IF mr_attri->custom_filter IS BOUND AND mr_attri->custom_filter <> ms_config-custom_filter. IF mr_attri->custom_filter IS BOUND AND mr_attri->custom_filter <> ms_config-custom_filter.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = |<p>Binding Error - Two different filter for same attribute used ({ mr_attri->name }).|. EXPORTING
val = |<p>Binding Error - Two different filter for same attribute used ({ mr_attri->name }).|.
ENDIF. ENDIF.
ENDMETHOD. ENDMETHOD.
@ -129,7 +133,8 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION.
DATA(lo_dummy) = CAST if_serializable_object( mr_attri->custom_filter_back ) ##NEEDED. DATA(lo_dummy) = CAST if_serializable_object( mr_attri->custom_filter_back ) ##NEEDED.
CATCH cx_root. CATCH cx_root.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = `<p>custom_filter_back used but it is not serializable, please use if_serializable_object`. EXPORTING
val = `<p>custom_filter_back used but it is not serializable, please use if_serializable_object`.
ENDTRY. ENDTRY.
ENDIF. ENDIF.
@ -220,10 +225,15 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION.
IF |/{ z2ui5_if_core_types=>cs_ui5-two_way_model }| = result. IF |/{ z2ui5_if_core_types=>cs_ui5-two_way_model }| = result.
RAISE EXCEPTION TYPE z2ui5_cx_util_error RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING val = `<p>Name of variable not allowed - x is reserved word - use anoter name for your attribute`. EXPORTING
val = `<p>Name of variable not allowed - x is reserved word - use anoter name for your attribute`.
ENDIF. ENDIF.
IF ms_config-switchdefaultmodel = abap_true.
result = |http>{ result }|.
ENDIF.
IF ms_config-path_only = abap_false. IF ms_config-path_only = abap_false.
result = |\{{ result }\}|. result = |\{{ result }\}|.
ENDIF. ENDIF.
@ -277,6 +287,10 @@ CLASS z2ui5_cl_core_srv_bind IMPLEMENTATION.
result = |/{ lv_id }|. result = |/{ lv_id }|.
IF ms_config-switchdefaultmodel = abap_true.
result = |http>{ result }|.
ENDIF.
IF config-path_only = abap_false. IF config-path_only = abap_false.
result = |\{{ result }\}|. result = |\{{ result }\}|.
ENDIF. ENDIF.

View File

@ -43,6 +43,7 @@ INTERFACE z2ui5_if_core_types
custom_filter_back TYPE REF TO z2ui5_if_ajson_filter, custom_filter_back TYPE REF TO z2ui5_if_ajson_filter,
tab TYPE REF TO data, tab TYPE REF TO data,
tab_index TYPE i, tab_index TYPE i,
switchDefaultModel TYPE abap_bool,
END OF ty_s_bind_config. END OF ty_s_bind_config.
TYPES: TYPES:
@ -67,6 +68,7 @@ INTERFACE z2ui5_if_core_types
BEGIN OF ty_s_next_frontend, BEGIN OF ty_s_next_frontend,
BEGIN OF s_view, BEGIN OF s_view,
xml TYPE string, xml TYPE string,
switchDefaultModel TYPE abap_bool,
check_destroy TYPE abap_bool, check_destroy TYPE abap_bool,
check_update_model TYPE abap_bool, check_update_model TYPE abap_bool,
END OF s_view, END OF s_view,

View File

@ -25,7 +25,8 @@ CLASS z2ui5_cl_app_app_js IMPLEMENTATION.
`` && |\n| && `` && |\n| &&
` onInit: async function () {` && |\n| && ` onInit: async function () {` && |\n| &&
`` && |\n| && `` && |\n| &&
` z2ui5.oConfig.pathname = this.getView().getModel().sServiceUrl;` && |\n| && ` z2ui5.oModel2 = this.getView().getModel("");` && |\n| &&
` z2ui5.oConfig.pathname = this.getView().getModel("http").sServiceUrl;` && |\n| &&
` if (z2ui5?.checkLocal == true ) {` && |\n| && ` if (z2ui5?.checkLocal == true ) {` && |\n| &&
` z2ui5.oConfig.pathname = window.location.href;` && |\n| && ` z2ui5.oConfig.pathname = window.location.href;` && |\n| &&
` };` && |\n| && ` };` && |\n| &&
@ -517,9 +518,9 @@ CLASS z2ui5_cl_app_app_js IMPLEMENTATION.
` var file = z2ui5.oUpload.oFileUpload.files[0];` && |\n| && ` var file = z2ui5.oUpload.oFileUpload.files[0];` && |\n| &&
` var reader = new FileReader();` && |\n| && ` var reader = new FileReader();` && |\n| &&
`` && |\n| && `` && |\n| &&
` reader.onload = function (evt) {` && |\n| &&
|\n|. |\n|.
result = result && result = result &&
` reader.onload = function (evt) {` && |\n| &&
` var vContent = evt.currentTarget.result;` && |\n| && ` var vContent = evt.currentTarget.result;` && |\n| &&
` this.setProperty("value", vContent);` && |\n| && ` this.setProperty("value", vContent);` && |\n| &&
` this.fireUpload();` && |\n| && ` this.fireUpload();` && |\n| &&

View File

@ -36,6 +36,15 @@ CLASS z2ui5_cl_app_manifest_json IMPLEMENTATION.
` },` && ` },` &&
` "dataSources": {` && ` "dataSources": {` &&
` "mainService": {` && ` "mainService": {` &&
` "uri": "/sap/opu/odata/DMO/API_TRAVEL_U_V2/",` &&
` "type": "OData",` &&
` "settings": {` &&
` "annotations": [],` &&
` "localUri": "localService/metadata.xml",` &&
` "odataVersion": "2.0"` &&
` }` &&
` },` &&
` "http": {` &&
` "uri": "/sap/bc/z2ui5",` && ` "uri": "/sap/bc/z2ui5",` &&
` "type": "OData",` && ` "type": "OData",` &&
` "settings": {` && ` "settings": {` &&
@ -98,6 +107,11 @@ CLASS z2ui5_cl_app_manifest_json IMPLEMENTATION.
` "dataSource": "mainService",` && ` "dataSource": "mainService",` &&
` "preload": true,` && ` "preload": true,` &&
` "settings": {}` && ` "settings": {}` &&
` },` &&
` "http": {` &&
` "dataSource": "http",` &&
` "preload": true,` &&
` "settings": {}` &&
` }` && ` }` &&
` },` && ` },` &&
` "resources": {` && ` "resources": {` &&

View File

@ -261,6 +261,14 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` break;` && |\n| && ` break;` && |\n| &&
` }` && |\n| && ` }` && |\n| &&
` break;` && |\n| && ` break;` && |\n| &&
` case 'SET_ODATA_MODEL':` && |\n| &&
` sap.ui.require([` && |\n| &&
` "sap/ui/model/odata/v2/ODataModel"` && |\n| &&
` ], async (ODataModel) => {` && |\n| &&
` var oModel = new ODataModel({ serviceUrl : args[1] });` && |\n| &&
` z2ui5.oView.setModel( oModel , args[2] );` && |\n| &&
` });` && |\n| &&
` break;` && |\n| &&
` case 'DOWNLOAD_B64_FILE':` && |\n| && ` case 'DOWNLOAD_B64_FILE':` && |\n| &&
` var a = document.createElement("a");` && |\n| && ` var a = document.createElement("a");` && |\n| &&
` a.href = args[1];` && |\n| && ` a.href = args[1];` && |\n| &&
@ -357,11 +365,13 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` z2ui5.isBusy = true;` && |\n| && ` z2ui5.isBusy = true;` && |\n| &&
` BusyIndicator.show();` && |\n| && ` BusyIndicator.show();` && |\n| &&
` z2ui5.oBody = {};` && |\n| && ` z2ui5.oBody = {};` && |\n| &&
` if (args[0][3]) {` && |\n| && ` if (args[0][3] || z2ui5.oController == this ) {` && |\n| &&
` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| && ` if (z2ui5.oResponse.PARAMS.S_VIEW?.SWITCHDEFAULTMODEL == true ){` && |\n| &&
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && ` var oModel = z2ui5.oView.getModel( "http");` && |\n| &&
` } else if (z2ui5.oController == this) {` && |\n| && ` }else{` && |\n| &&
` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| && ` oModel = z2ui5.oView.getModel();` && |\n| &&
` }` && |\n| &&
` z2ui5.oBody.XX = oModel.getData().XX;` && |\n| &&
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| && ` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
` } else if (z2ui5.oControllerPopup == this) {` && |\n| && ` } else if (z2ui5.oControllerPopup == this) {` && |\n| &&
` if (z2ui5.oViewPopup) {` && |\n| && ` if (z2ui5.oViewPopup) {` && |\n| &&
@ -384,9 +394,6 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` }` && |\n| && ` }` && |\n| &&
` }` && |\n| && ` }` && |\n| &&
` )` && |\n| && ` )` && |\n| &&
` // if (args[0][1]) {` && |\n| &&
` // z2ui5.oController.ViewDestroy();` && |\n| &&
` // }` && |\n| &&
` z2ui5.oBody.ID = z2ui5.oResponse.ID;` && |\n| && ` z2ui5.oBody.ID = z2ui5.oResponse.ID;` && |\n| &&
` z2ui5.oBody.ARGUMENTS = args;` && |\n| && ` z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
` z2ui5.oBody.ARGUMENTS.forEach((item, i) => {` && |\n| && ` z2ui5.oBody.ARGUMENTS.forEach((item, i) => {` && |\n| &&
@ -465,37 +472,6 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` };` && |\n| && ` };` && |\n| &&
` if ( oParams.icon = 'None' ) { delete oParams.icon };` && |\n| && ` if ( oParams.icon = 'None' ) { delete oParams.icon };` && |\n| &&
` MessageBox[params[msgType].TYPE](params[msgType].TEXT, oParams);` && |\n| && ` MessageBox[params[msgType].TYPE](params[msgType].TEXT, oParams);` && |\n| &&
` return;` && |\n| &&
`` && |\n| &&
` switch (params[msgType].TYPE) {` && |\n| &&
` case 'error':` && |\n| &&
` MessageBox.error(params[msgType].TEXT, oParams);` && |\n| &&
` break;` && |\n| &&
` case 'warning':` && |\n| &&
` MessageBox.error(params[msgType].TEXT, oParams);` && |\n| &&
` break;` && |\n| &&
` default:` && |\n| &&
` MessageBox.shwo(params[msgType].TEXT, oParams);` && |\n| &&
` break;` && |\n| &&
` }` && |\n| &&
` return;` && |\n| &&
`` && |\n| &&
` if (params[msgType].TYPE) {` && |\n| &&
` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| &&
` } else {` && |\n| &&
` MessageBox.show(params[msgType].TEXT, {` && |\n| &&
` styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| &&
` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| &&
` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| &&
` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| &&
` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| &&
` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| &&
` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| &&
` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',` && |\n| &&
` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| &&
` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| &&
` })` && |\n| &&
` }` && |\n| &&
` }` && |\n| && ` }` && |\n| &&
` }` && |\n| && ` }` && |\n| &&
` },` && |\n| && ` },` && |\n| &&
@ -504,9 +480,13 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` },` && |\n| && ` },` && |\n| &&
` async displayView(xml, viewModel) {` && |\n| && ` async displayView(xml, viewModel) {` && |\n| &&
` let oview_model = new JSONModel(viewModel);` && |\n| && ` let oview_model = new JSONModel(viewModel);` && |\n| &&
` var oModel = oview_model;` && |\n| &&
` if (z2ui5.oResponse.PARAMS.S_VIEW?.SWITCHDEFAULTMODEL == true){` && |\n| &&
` oModel = z2ui5.oModel2;` && |\n| &&
` }` && |\n| &&
` z2ui5.oView = await XMLView.create({` && |\n| && ` z2ui5.oView = await XMLView.create({` && |\n| &&
` definition: xml,` && |\n| && ` definition: xml,` && |\n| &&
` models: oview_model,` && |\n| && ` models: oModel,` && |\n| &&
` controller: z2ui5.oController,` && |\n| && ` controller: z2ui5.oController,` && |\n| &&
` id: 'mainView',` && |\n| && ` id: 'mainView',` && |\n| &&
` preprocessors: {` && |\n| && ` preprocessors: {` && |\n| &&
@ -518,8 +498,9 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` }` && |\n| && ` }` && |\n| &&
` });` && |\n| && ` });` && |\n| &&
` z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");` && |\n| && ` z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");` && |\n| &&
|\n|. ` if (z2ui5.oResponse.PARAMS.S_VIEW?.SWITCHDEFAULTMODEL == true){` && |\n| &&
result = result && ` z2ui5.oView.setModel(oview_model, "http");` && |\n| &&
` }` && |\n| &&
` this._oApp.removeAllPages();` && |\n| && ` this._oApp.removeAllPages();` && |\n| &&
` this._oApp.insertPage(z2ui5.oView);` && |\n| && ` this._oApp.insertPage(z2ui5.oView);` && |\n| &&
` },` && |\n| && ` },` && |\n| &&

View File

@ -681,7 +681,7 @@ CLASS z2ui5_cl_xml_view DEFINITION
valuestatetext TYPE clike OPTIONAL valuestatetext TYPE clike OPTIONAL
placeholder TYPE clike OPTIONAL placeholder TYPE clike OPTIONAL
showsuggestion TYPE clike OPTIONAL showsuggestion TYPE clike OPTIONAL
VISIBLE type CLIKE optional visible TYPE clike OPTIONAL
RETURNING RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view. VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
@ -3928,6 +3928,45 @@ CLASS z2ui5_cl_xml_view DEFINITION
RETURNING RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view. VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS smart_filter_bar
IMPORTING
id TYPE clike OPTIONAL
persistencyKey TYPE clike OPTIONAL
entitySet TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS control_configuration
IMPORTING
id TYPE clike OPTIONAL
prevInitDataFetchInValHelpDia TYPE clike OPTIONAL
visibleInAdvancedArea TYPE clike OPTIONAL
key TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS _control_configuration
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS smart_table
IMPORTING
id TYPE clike OPTIONAL
smartFilterId TYPE clike OPTIONAL
tableType TYPE clike OPTIONAL
editable TYPE clike OPTIONAL
initiallyVisibleFields TYPE clike OPTIONAL
entitySet TYPE clike OPTIONAL
useVariantManagement TYPE clike OPTIONAL
useExportToExcel TYPE clike OPTIONAL
useTablePersonalisation TYPE clike OPTIONAL
header TYPE clike OPTIONAL
showRowCount TYPE clike OPTIONAL
enableExport TYPE clike OPTIONAL
enableAutoBinding TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS form_toolbar METHODS form_toolbar
RETURNING RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view. VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
@ -10406,6 +10445,8 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
( n = `form` v = `sap.ui.layout.form` ) ( n = `form` v = `sap.ui.layout.form` )
( n = `editor` v = `sap.ui.codeeditor` ) ( n = `editor` v = `sap.ui.codeeditor` )
( n = `mchart` v = `sap.suite.ui.microchart` ) ( n = `mchart` v = `sap.suite.ui.microchart` )
( n = `smartFilterBar` v = `sap.ui.comp.smartfilterbar` )
( n = `smartTable` v = `sap.ui.comp.smarttable` )
( n = `webc` v = `sap.ui.webc.main` ) ( n = `webc` v = `sap.ui.webc.main` )
( n = `uxap` v = `sap.uxap` ) ( n = `uxap` v = `sap.uxap` )
( n = `sap` v = `sap` ) ( n = `sap` v = `sap` )
@ -10745,6 +10786,7 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD HarveyBallMicroChartItem. METHOD HarveyBallMicroChartItem.
result = _generic( name = `HarveyBallMicroChartItem` result = _generic( name = `HarveyBallMicroChartItem`
ns = `mchart` ns = `mchart`
t_prop = VALUE #( ( n = `id` v = id ) t_prop = VALUE #( ( n = `id` v = id )
@ -10754,6 +10796,59 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
( n = `fractionScale` v = fractionScale ) ) ). ( n = `fractionScale` v = fractionScale ) ) ).
ENDMETHOD. ENDMETHOD.
METHOD smart_filter_bar.
result = _generic( name = `SmartFilterBar`
ns = `smartFilterBar`
t_prop = VALUE #( ( n = `id` v = id )
( n = `entitySet` v = entitySet )
( n = `persistencyKey` v = persistencyKey ) ) ).
ENDMETHOD.
METHOD control_configuration.
result = me.
_generic( name = `ControlConfiguration`
ns = `smartFilterBar`
t_prop = VALUE #( ( n = `id` v = id )
( n = `key` v = key )
( n = `visibleInAdvancedArea` v = z2ui5_cl_util=>boolean_abap_2_json( visibleInAdvancedArea ) )
( n = `preventInitialDataFetchInValueHelpDialog` v = z2ui5_cl_util=>boolean_abap_2_json( prevInitDataFetchInValHelpDia ) )
) ).
ENDMETHOD.
METHOD smart_table.
result = _generic( name = `SmartTable`
ns = `smartTable`
t_prop = VALUE #(
( n = `id` v = id )
( n = `smartFilterId` v = smartFilterId )
( n = `tableType` v = tableType )
( n = `editable` v = z2ui5_cl_util=>boolean_abap_2_json( editable ) )
( n = `initiallyVisibleFields` v = initiallyVisibleFields )
( n = `entitySet` v = entitySet )
( n = `useVariantManagement` v = z2ui5_cl_util=>boolean_abap_2_json( useVariantManagement ) )
( n = `useExportToExcel` v = z2ui5_cl_util=>boolean_abap_2_json( useExportToExcel ) )
( n = `useTablePersonalisation` v = z2ui5_cl_util=>boolean_abap_2_json( useTablePersonalisation ) )
( n = `header` v = header )
( n = `showRowCount` v = z2ui5_cl_util=>boolean_abap_2_json( showRowCount ) )
( n = `enableExport` v = z2ui5_cl_util=>boolean_abap_2_json( enableExport ) )
( n = `enableAutoBinding` v = z2ui5_cl_util=>boolean_abap_2_json( enableAutoBinding ) )
) ).
ENDMETHOD.
METHOD _control_configuration.
result = _generic( name = `controlConfiguration`
ns = `smartFilterBar`
).
ENDMETHOD.
METHOD viz_dataset. METHOD viz_dataset.
result = _generic( name = 'dataset' result = _generic( name = 'dataset'
ns = 'viz' ). ns = 'viz' ).

View File

@ -15,6 +15,7 @@ INTERFACE z2ui5_if_client
popup_nav_container_to TYPE string VALUE `POPUP_NAV_CONTAINER_TO`, popup_nav_container_to TYPE string VALUE `POPUP_NAV_CONTAINER_TO`,
download_b64_file TYPE string VALUE `DOWNLOAD_B64_FILE`, download_b64_file TYPE string VALUE `DOWNLOAD_B64_FILE`,
set_size_limit TYPE string VALUE `SET_SIZE_LIMIT`, set_size_limit TYPE string VALUE `SET_SIZE_LIMIT`,
set_odata_model TYPE string VALUE `SET_ODATA_MODEL`,
END OF cs_event. END OF cs_event.
CONSTANTS: CONSTANTS:
@ -30,7 +31,8 @@ INTERFACE z2ui5_if_client
METHODS view_display METHODS view_display
IMPORTING IMPORTING
val TYPE clike. val TYPE clike
switchDefaultModel TYPE abap_bool DEFAULT abap_false.
METHODS view_model_update. METHODS view_model_update.
@ -160,6 +162,7 @@ INTERFACE z2ui5_if_client
custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL
!tab TYPE data OPTIONAL !tab TYPE data OPTIONAL
tab_index TYPE i OPTIONAL tab_index TYPE i OPTIONAL
switchDefaultModel TYPE abap_bool DEFAULT abap_false
RETURNING RETURNING
VALUE(result) TYPE string. VALUE(result) TYPE string.
@ -174,6 +177,7 @@ INTERFACE z2ui5_if_client
custom_filter_back TYPE REF TO z2ui5_if_ajson_filter OPTIONAL custom_filter_back TYPE REF TO z2ui5_if_ajson_filter OPTIONAL
!tab TYPE data OPTIONAL !tab TYPE data OPTIONAL
tab_index TYPE i OPTIONAL tab_index TYPE i OPTIONAL
switchDefaultModel TYPE abap_bool DEFAULT abap_false
RETURNING RETURNING
VALUE(result) TYPE string. VALUE(result) TYPE string.
@ -183,6 +187,7 @@ INTERFACE z2ui5_if_client
!path TYPE abap_bool DEFAULT abap_false !path TYPE abap_bool DEFAULT abap_false
custom_mapper TYPE REF TO z2ui5_if_ajson_mapping OPTIONAL custom_mapper TYPE REF TO z2ui5_if_ajson_mapping OPTIONAL
custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL custom_filter TYPE REF TO z2ui5_if_ajson_filter OPTIONAL
switchDefaultModel TYPE abap_bool DEFAULT abap_false
RETURNING RETURNING
VALUE(result) TYPE string. VALUE(result) TYPE string.