update message box

This commit is contained in:
Lars Kaldewey 2024-10-26 10:50:41 +00:00
parent db038379ff
commit bd5c3cb045
3 changed files with 906 additions and 856 deletions

View File

@ -11,7 +11,7 @@ Set the correct backend system in the yamls <br>
Replace "/sap/bc/z2ui5" with your endpoint in the manifest
```
npm i
npm run start
npm run start-noflp
```
#### Before PR

View File

@ -307,11 +307,6 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
},
eB(...args) {
// var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
//debugger;
// z2ui5.oRouter.navTo("RouteView2");
// return;
if (!window.navigator.onLine) {
MessageBox.alert('No internet connection! Please reconnect to the server and try again.');
return;
@ -357,9 +352,9 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
}
}
)
if (args[0][1]) {
z2ui5.oController.ViewDestroy();
}
// if (args[0][1]) {
// z2ui5.oController.ViewDestroy();
// }
z2ui5.oBody.ID = z2ui5.oResponse.ID;
z2ui5.oBody.ARGUMENTS = args;
z2ui5.oBody.ARGUMENTS.forEach((item, i) => {
@ -423,6 +418,36 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/
}
;
} else if (msgType === 'S_MSG_BOX') {
let oParams = {
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
};
if ( oParams.icon = 'None' ) { delete oParams.icon };
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 {

View File

@ -327,11 +327,6 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` },` && |\n| &&
` eB(...args) {` && |\n| &&
`` && |\n| &&
` // var oRouter = sap.ui.core.UIComponent.getRouterFor(this);` && |\n| &&
` //debugger;` && |\n| &&
` // z2ui5.oRouter.navTo("RouteView2");` && |\n| &&
` // return;` && |\n| &&
`` && |\n| &&
` if (!window.navigator.onLine) {` && |\n| &&
` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| &&
` return;` && |\n| &&
@ -377,9 +372,9 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` }` && |\n| &&
` }` && |\n| &&
` )` && |\n| &&
` if (args[0][1]) {` && |\n| &&
` z2ui5.oController.ViewDestroy();` && |\n| &&
` }` && |\n| &&
` // if (args[0][1]) {` && |\n| &&
` // z2ui5.oController.ViewDestroy();` && |\n| &&
` // }` && |\n| &&
` z2ui5.oBody.ID = z2ui5.oResponse.ID;` && |\n| &&
` z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
` z2ui5.oBody.ARGUMENTS.forEach((item, i) => {` && |\n| &&
@ -443,6 +438,36 @@ CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
` }` && |\n| &&
` ;` && |\n| &&
` } else if (msgType === 'S_MSG_BOX') {` && |\n| &&
`` && |\n| &&
` let oParams = {` && |\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| &&
` if ( oParams.icon = 'None' ) { delete oParams.icon };` && |\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| &&