Skip to Content
Author's profile photo Ram Kumar Karunamurthy

Custom animated message dialog box by using SAP WebIDE

Hi All,

The message box is a special dialog box that allows you to display messages to the user. But, some cases user requires animated message dialog box which helps that more user experience. Here, I will show you how to build animated message dialog by using SAP WebIDE.

1. Create separate “Images” folder in your project. Add animated *.gif file inside images folder.

     import image.png

          choose image.png

2. Create xml fragment. Inside view folder create fragment.


3. Mention file name. ( Please follow proper naming conventions like Accept, Reject, Information, Warning etc)


4. In fragment view, design your message dialog as per business requirements. My case, Animation and Message to be add.


<core:FragmentDefinition xmlns="sap.m" xmlns:l="sap.ui.layout" xmlns:core="sap.ui.core">
  <Dialog title="Success">
  <Image id="imgAccept" width="70px" height="70px" src="../Images/Dialog_Success.gif"/>
  <Text text="Your Sales Order has been updated..!!" />
  <Button text="OK" press="onOk"/>

     Now, Message dialog has been created.

5. Now, When user update the business transaction, message box to be appear.

     screen update and exit.png


  6. Instaniate the Accept fragment


_getDialog: function() {
  if (!this._oDialog) {
  this._oDialog = sap.ui.xmlfragment("sap.ui.view.Accept");
  return this._oDialog;

7. After Update your transaction call this message dialog.


oModel.update("/Accessories(OrderId='" + orderId + "',ItemNo='" + pItemNo + "')", dataPayload, {
  success: function() {
  this._Dialog = sap.ui.xmlfragment("ztraining.view.Accept",this);;
  error: function() {
  // Error dialog

8. Provide Event for to close Message Dialog after appears.

onOk: function() {

9. Wow, Everything has been done.


Thats it.. !!

I will be glad to hear your feedback and listen to all your questions.



Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.