<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Adding event in custom control that blocks default event in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaa-p/12732348#M4778550</link>
    <description>&lt;P&gt;What is the reason for extending sap.m.StandardTile in the first place? The StandardTile is deprecated since UI5 1.50. Consider using sap.m.GenericTile instead which supports the &lt;A href="https://ui5.sap.com/#/api/sap.m.LoadState"&gt;"Disabled" state among others&lt;/A&gt; out of the box. If the GenericTile is disabled, no press event will be fired.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;GenericTile xmlns="sap.m" state="Disabled" pressEnabled="false"&amp;gt;&lt;BR /&gt;  &amp;lt;!-- ... --&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sample: &lt;A href="https://ui5.sap.com/#/entity/sap.m.GenericTile/sample/sap.m.sample.GenericTileStates/code" target="test_blank"&gt;https://ui5.sap.com/#/entity/sap.m.GenericTile/sample/sap.m.sample.GenericTileStates/code&lt;/A&gt;&lt;BR /&gt;API Reference: &lt;A href="https://ui5.sap.com/#/api/sap.m.GenericTile" target="test_blank"&gt;https://ui5.sap.com/#/api/sap.m.GenericTile&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Nov 2023 00:24:02 GMT</pubDate>
    <dc:creator>boghyon</dc:creator>
    <dc:date>2023-11-26T00:24:02Z</dc:date>
    <item>
      <title>Adding event in custom control that blocks default event</title>
      <link>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaq-p/12732346</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
  &lt;P&gt;I have a custom control that extends from sap.m.StandardTile and I want to add an enabled property to it, so I can prevent the "press" event from firing if enabled = false.&lt;/P&gt;
  &lt;P&gt;My trouble now is that in this example of adding a custom event to a custom control that extends the default Button: &lt;A href="https://sapui5.hana.ondemand.com/#/topic/d5b756bf4e9a4d67961fa21e1ba12c9e"&gt;Documentation - Demo Kit - SAPUI5 SDK (ondemand.com)&lt;/A&gt; .&lt;/P&gt;
  &lt;P&gt;Where does the function this.fireHover() come from? I checked the api reference for Button and there is no such thing as .fireHover() in it. So is this function that is the implemented in the custom control and is just missing in this example or am I missing something?&lt;/P&gt;
  &lt;P&gt;In my use case, I would simply think that I can override the press method like so:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2229060-press.png" /&gt;&lt;/P&gt;
  &lt;P&gt;and define the new enabled property like so:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2229055-properties.png" /&gt;&lt;/P&gt;
  &lt;P&gt; However the press event still fires, even if I set the new enabled propert to enabled = "false" in the XML.&lt;/P&gt;
  &lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;
  &lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 12:01:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaq-p/12732346</guid>
      <dc:creator>davidsigleinit</dc:creator>
      <dc:date>2023-11-24T12:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding event in custom control that blocks default event</title>
      <link>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaa-p/12732347#M4778549</link>
      <description>&lt;P&gt;Hi, I didn't test this, but you can try to overwrite firePress like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;firePress: function () {
    if (this.getEnabled()) {
         StandardTile.prototype.firePress.call(this);
    }
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Nov 2023 13:09:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaa-p/12732347#M4778549</guid>
      <dc:creator>AlexNecula30</dc:creator>
      <dc:date>2023-11-24T13:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding event in custom control that blocks default event</title>
      <link>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaa-p/12732348#M4778550</link>
      <description>&lt;P&gt;What is the reason for extending sap.m.StandardTile in the first place? The StandardTile is deprecated since UI5 1.50. Consider using sap.m.GenericTile instead which supports the &lt;A href="https://ui5.sap.com/#/api/sap.m.LoadState"&gt;"Disabled" state among others&lt;/A&gt; out of the box. If the GenericTile is disabled, no press event will be fired.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;GenericTile xmlns="sap.m" state="Disabled" pressEnabled="false"&amp;gt;&lt;BR /&gt;  &amp;lt;!-- ... --&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sample: &lt;A href="https://ui5.sap.com/#/entity/sap.m.GenericTile/sample/sap.m.sample.GenericTileStates/code" target="test_blank"&gt;https://ui5.sap.com/#/entity/sap.m.GenericTile/sample/sap.m.sample.GenericTileStates/code&lt;/A&gt;&lt;BR /&gt;API Reference: &lt;A href="https://ui5.sap.com/#/api/sap.m.GenericTile" target="test_blank"&gt;https://ui5.sap.com/#/api/sap.m.GenericTile&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2023 00:24:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/adding-event-in-custom-control-that-blocks-default-event/qaa-p/12732348#M4778550</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2023-11-26T00:24:02Z</dc:date>
    </item>
  </channel>
</rss>

