cancel
Showing results for 
Search instead for 
Did you mean: 

POPUP is not getting displayed

nalamabhiram
Explorer
0 Kudos

Hi All,

I am trying  to add some filters and sorting buttons to the sap.m.table,so I landed up using new sap.m.ViewSettingsDialog.

But while in process I came to know my code is not working for Popover. I have even tried the basic Popover  as shown below.

none of the elements explained under popup section in below link is  getting displayed during compiling.

SAPUI5 Explored




new sap.m.Button( {

  icon: "sap-icon://action-settings",

  text:"dialog",

  tap: function(){

  console.log("BUTTON PRESSED"),

  new sap.m.Popover({ title:"sort and  filter"})

                                        }

}),

Could you please explain if I am missing some thing.do i need to add any sources in the index file specially for Popup's

Note:In above code while compiling "dialog" Button is getting displayed and "BUTTON PRESSED" is getting displayed in log but not popover and its not showing any error as well.

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Abhiram,

Which version of UI5 are you using? Since 1.20.0 version, tap event is deprecated for sap.m.Button.

API - JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.m.Button


Try using press event, instead of tap and check whether that works.


Regards,

Sai Vellanki.

nalamabhiram
Explorer
0 Kudos

...I have tried with both press and tap...

Console.log  which is inside the function is getting displayed for both press or tap.... but not popover...

santhu_gowdaz
Active Contributor
0 Kudos

You are declared the popover but you are not opened. that's the reson you are not getting popover

var oPopOver =  new sap.m.Popover({ title:"sort and  filter"})

                                        };

oPopOver.openBy();


JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.m.Popover


example- openui5/src/sap.m/test/sap/m/demokit/sample/Popover at master · SAP/openui5 · GitHub

Former Member
0 Kudos

+1 to santosh comments, you have to mention the control responsible for opening the popup.

something like

var button = new sap.m.Button({

  press : function(){

  var popup = new sap.m.Popover({ title:"sort and  filter"})

  console.log(popup)

  popup.openBy(button);

  }

  })

nalamabhiram
Explorer
0 Kudos

thank you very much santosh and indrajith,

Now its working after providing popup.openBy(button);

but  I am facing the same issue with  ViewSettingsDialog as well and the issue still persist even after placing popup.openBy(button)...could you please say where I am going wrong

button=new sap.m.Button( {

  icon: "sap-icon://action-settings",

  text:"dialog",

  press: function(){

  oPopOver=new sap.m.ViewSettingsDialog({ title:"sort and  filter"})

  oPopOver.openBy(button);

  }

}),

santhu_gowdaz
Active Contributor
0 Kudos

In your code you are using sap.m.popover but now you changed?

okey sap.m.ViewSettingsDialog not having OpenBy method.use open() method,

API- JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.m.ViewSettingsDialog

Working example- openui5/ViewSettingsDialog.html at master · SAP/openui5 · GitHub

explored-SAPUI5 Explored

nalamabhiram
Explorer
0 Kudos

ya...I am using both in different pages...

thanks ..its working with open() method,

Answers (1)

Answers (1)

Private_Member_15166
Active Contributor
0 Kudos

Use this.

new sap.m.Button( {

  icon: "sap-icon://action-settings",

  text:"dialog",

  press: function(){                                                                 //press instead of tap

  console.log("BUTTON PRESSED"),

  new sap.m.Popover({ title:"sort and  filter"})

                                        }

}),

nalamabhiram
Explorer
0 Kudos

...I have tried with both press and tap...

Console.log  which is inside the function is getting displayed for both press or tap.... but not popover...