Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Calling an event from an XML fragment

$
0
0

I've created an XML fragment and have tied it to one of my controllers.  On Button press I am trying to call a method from the fragment to my controller. My event is never fired and I'm not sure why.  Any ideas?  My source code is below:

 

XML Fragment code - calling my controller method:

<Button

    id="gross"

    text="Breakdown - Gross"

    type="Emphasized"

    icon="sap-icon://history"

    press="launchChartWrapper"

    >

</Button>

 

Instantiating the fragment - and tying it to my controller:

var oFragment = sap.ui.xmlfragment("zsearch_afe.DetailTabs.budget",this.getView().getController());

 

The named method in my Controller:

launchChartWrapper: function(oEvent){

  alert("Click Event Fired");

  },


Viewing all articles
Browse latest Browse all 8124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>