Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Model Scope? Set Text Property for Button?

$
0
0

I'm trying to set the text property for a button in an ActionSheet to a field in my model like so:

 

  var oActionSheet = new sap.m.ActionSheet({           buttons: [            new sap.m.Button( {                text : "{RESIDENTIAL}",                icon : "sap-icon://outgoing-call",                press:  [ oController.onResidentialFacetime, oController ]}).addStyleClass("newButton"),            new sap.m.Button( {                text : "{EMERGENCY}",                icon : "sap-icon://iphone",                press:  [ oController.onEmergencyFacetime, oController ]}).addStyleClass("newButton"),                            new sap.m.Button( {                text : "{EMAIL}",                icon : "sap-icon://email",                press:  [ oController.onEmailFacetime, oController ]}).addStyleClass("newButton")           ],           placement: sap.m.PlacementType.Bottom,           cancelButtonPress: function(){            jQuery.sap.log.info("sap.m.ActionSheet: cancelButton is pressed");           }           });

However, it's coming back undefined. I tried setting an absolute path ("/contents/RESIDENTIAL") but it always returns undefined. If I define the button outside of the ActionSheet, it gets the value properly. So I was thinking it's not scoped right? How do I pass it in or reference it? I think this is another easy one, I just don't see it. Thanks so much!

 

#mvc/oop noob


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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