Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html style="height: 100%;">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">
    <title>Handle press / click event on disabled control (https://stackoverflow.com/q/24822097/5846045)</title>
    <script id="sap-ui-bootstrap"
      src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
      data-sap-ui-libs="sap.ui.core,sap.m"
      data-sap-ui-async="true"
      data-sap-ui-theme="sap_fiori_3"
      data-sap-ui-compatversion="edge"
      data-sap-ui-excludejquerycompat="true"
      data-sap-ui-xx-waitfortheme="init"
    ></script>
  </head>
  <body id="content" class="sapUiBody" style="height: 100%;"></body>
</html>
 
sap.ui.require([
  "sap/ui/core/Core",
], Core => Core.attachInit(() => sap.ui.require([
  "sap/ui/core/Fragment",
], Fragment => Fragment.load({
  definition: `<Select xmlns="sap.m" enabled="false" />`,
}).then(control => {
  "use strict";
  control.addEventDelegate({
    onclick:/*or ontap: */() => alert("Select that other item first!"),
    // See the API reference of `sap/ui/events/ControlEvents` for other available events.
  });
  control.placeAt("content");
}))));
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
boghyonpro
0viewers