Skip to Content
avatar image
Former Member

How to prevent form postback on UI5 Button Press event

Hi

When i click on the UI5 button, the page is getting postbacked (reloading), So how to prevent the form being postbacked on the button press event.

View Code:

 <m:Button id="btnHelp" icon="sap-icon://sys-help" tooltip="Help"  iconFirst="true" width="auto" enabled="true" visible="true" iconDensityAware="false" press="onHelpDocPress" type="Default" />
Controller Code:

onHelpDocPress: function (oEvent) {
   
    var dialog = new Dialog({
        title: 'Default Message',
        type: 'Message',
        content: new Text({
            text: 'test text'
        }),
        beginButton: new Button({
            text: 'OK',
            press: function () {
                dialog.close();
            }
        }),
        afterClose: function () {
            dialog.destroy();
        }
    });
    dialog.open();   
}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 07, 2017 at 11:06 AM

    What do you want to do exactly ?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 18, 2017 at 10:24 AM

    form tag in my HTML page which causes the postback. after removing the tag the page didn't postback.

    Add comment
    10|10000 characters needed characters exceeded