Skip to Content
avatar image
Former Member

Panel Click

Hi All,

I have created a panel and shows up corrrectly.

What i want is ability to click on Panel and alert box shows up. But this is not happening.

I need user's to click on this and get an alert.

Code:

var L3ST70 = new sap.ui.commons.Panel("L3ST70",{applyContentPadding: true, width: "120px", height: "130px", showCollapseIcon: false,

click: function(){alert("clicked");}

});

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 21, 2015 at 04:06 PM

    Hi Asif

    You have to extend the Panel control like this

    JS Bin - Collaborative JavaScript Debugging

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      i have resolved it myself with following code:

      sap.ui.commons.Panel.extend("StationPanel", {

         metadata: {

         events: {

         "press" : {} 
         }

        },


         onmouseup : function(evt) { 

         this.firePress();

        },

         renderer: {}
      });

      var L3ST70 = new StationPanel("L3ST70",{applyContentPadding: true, width: "120px",height: "130px",showCollapseIcon: false,

         press: function(evt) {

         alert("Button " + evt.getSource().getId() + " was hovered.");

        }

      });