Skip to Content
author's profile photo Former Member
Former Member

how to call a function based on user input in dialog box? onclose is not working

hi,

I hav used message box to get input from user..based on user input i want to navigate to other page... how wil i do tat?

MessageBox.confirm( "Are you sure want to logout?", { icon: MessageBox.Icon.WARNING, title: "Logout", styleClass: bCompact? "sapUiSizeCompact" : "", actions: [MessageBox.Action.YES, MessageBox.Action.NO], initialFocus: MessageBox.Action.CANCEL, onClose: function(oAction) { console.log(oAction); } } );
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 15, 2016 at 11:57 PM

    Hi Krishna,


    Something like this? JS Bin - Collaborative JavaScript Debugging


    Regards,

    Sai.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 06:41 PM

    Helo Krishna,

    Hope this patter helps you.

    openDialog: function(a) {

    new sap.m.Dialog(this.createId("yourDialog"), {

    title: "title",

    showHeader: true,

    content: [ new sap.m.Text(this.createId("dialogTextField"), {

    text: "Somte text"

    }).addStyleClass("sapUiSmallMarginBottom"),

    /* inster content here */

    ],

    beginButton: new sap.m.Button({

    text: "OK Button",

    press: function() {

    /* handle Ok button */

    t.byId("yourDialog").close()

    }

    }),

    endButton: new sap.m.Button({

    text: "Cancel button"

    press: function() {

    /* handle Cancel button */

    t.byId("yourDialog").close()

    }

    }),

    afterClose: function(e) {

    this.destroy()

    }

    }).addStyleClass("sapUiPopupWithPadding").open()

    }

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.