Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

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

    Hi Asif

    You have to extend the Panel control like this

    JS Bin - Collaborative JavaScript Debugging

    Add a 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.");

      }

      });

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.