on 03-11-2019 1:22 PM
Hello,
i have a problem with m/messagePopover.
Odata returns severity as error, information, warning (no capital letter in the beginning)
and then I get this error:
Uncaught Error: "error" is of type string, expected sap.ui.core.MessageType for property "type" of Element sap.m.MessageItem#__item31-__popover11-0
when i convert error to Error (with capital letter at the beginning) I get no more error ?
is it true, that I have to convert all the returned severities in frontend ?
Thanks for your help
fragment:
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <MessagePopover items="{message>/messageSet}"> <MessageItem type="{message>severity}" title="{message>message}"></MessageItem> </MessagePopover> </core:FragmentDefinition>
Hi Helmut Sieberer,
You don't need to convert the messages returned by the odata request, SAP OData parser will automatically convert the message from the response and set it to the message model. (True, we need to convert them if you want to do it manually).
In the manifest.json you need to add the below property for odata parser to come to action. BTW you can get the message model using
sap.ui.getCore().getMessageManager().getMessageModel()
"sap.ui5": {
"handleValidation": true,
You can find a lot about online help, blogs and question.
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks for your answer
but why does oData return error and not Error.
my code is:
CALL METHOD O_MESSAGE_CONTAINER->ADD_MESSAGE EXPORTING IV_MSG_TYPE = SY-MSGTY IV_MSG_ID = SY-MSGID IV_MSG_NUMBER = SY-MSGNO IV_MSG_V1 = SY-MSGV1 IV_MSG_V2 = SY-MSGV2 IV_MSG_V3 = SY-MSGV3 IV_MSG_V4 = SY-MSGV4 IV_ADD_TO_RESPONSE_HEADER = ABAP_TRUE.
and when I look in the returned messages in frontend it says error for severity (not Error)
so I have to convert all the severities (error to Error, warning to Warning...) - I just wonder about this...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it should be Error w capital letter
https://sapui5.hana.ondemand.com/#/api/sap.ui.core.MessageType
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.