Skip to Content
0

How to prevent form postback on UI5 Button Press event

Sep 05, 2017 at 11:54 AM

26

avatar image
Former Member

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();   
}
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Joseph BERTHE Sep 07, 2017 at 11:06 AM
0

What do you want to do exactly ?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member
Sep 18, 2017 at 10:24 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded