on 11-20-2023 11:51 PM
Hi,
Is it possible to add SAPUI5 client-side error messages/validations into the same Message Popover handled by the framework when using Fiori Elements ? I try to use sap.ui.core.message.ControlMessageProcessor and I can see my messages in the Message Manager message model when debugging (both OData and Frontend), however the Message Popover only shows the OData error messages. How can I show both ?
Here is my code. For context, the following code is implemented in the Event handler "fieldChange" of sap.ui.comp.smarttable.SmartTable. The target works fine since the app successfully changes the value state to Error (red) on the correct control and displays the value state error message on the field. My issue is that it doesn't add it to the Message Popover. What am I missing?
(this is on ABAP Platform 1909 and SAPUI5 1.71 version)
// ____________________________________________________var oMessageManager = sap.ui.getCore().getMessageManager();
var oMessageProcessor = new sap.ui.core.message.ControlMessageProcessor();
oMessageManager.registerMessageProcessor(oMessageProcessor);
oMessageManager.registerObject(this.getView(), true);
var sTarget = oEvent.getParameters().changeEvent.getSource().getInnerControls()[0].getId() + "/value";
var fnAddMessage = function() {
return new Promise(function(resolve, reject) {
var oMessage = new sap.ui.core.message.Message({
message: "Duplicate",
persistent: false,
type: sap.ui.core.MessageType.Error,
target: sTarget,
processor: oMessageProcessor
});
oMessageManager.addMessages(oMessage);
resolve();
});
};
this.extensionAPI.securedExecution(fnAddMessage);
// ____________________________________________________
You can use the securedapi for your action and add custom messages to the messagemanager, check the docu here https://ui5.sap.com/#/topic/6a39150ad3e548a8b5304d32d560790a
Here an example on how to do this: https://ui5.sap.com/#/topic/5a9a2a0f2c054b9686acb3497ba32ae2.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.