on 10-23-2013 11:56 AM
Hi,
the following question raised up only because we are/must using the sap.ui.core.Message in a ux3.Shell as this is mandatory for the notification bar. Our use case want to have the functionality to react on the click event of the message. The message itself does not have a pre-defined event "press".
Therefore I think about to add a common event "onclick" via "attachEvent". My approach fails currently on I would like to understand, what needs to be done.
My code looks like this:
var oMessageNotifier = new sap.ui.ux3.Notifier( {
title : "Your system messages"
});
oNotr.addNotifier(oMessageNotifier);
oNotiBar.setVisibleStatus(sap.ui.ux3.NotificationBarStatus.Default);
var error = new sap.ui.core.Message("msg", {text:"fooBuh"});
error.attachEvent("onclick",function(event){alert('foo');});
oMessageNotifier.addMessage(error);
Ok. The way to fetch events of message selection inside of a NotificationBar is:
...view.js
{....
create.content = function(){
...
function clickListener(oEvent) { | ||
var oMessage = oEvent.getParameter("message"); | ||
alert("Message selected: " + oMessage.url()); | ||
}; |
...
oNotifier2.attachMessageSelected(clickListener);
...
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Janko,
You can get the object by jQuery using the id, and then set the event "onclick"
http://api.jquery.com/category/events/
Regards,
Jose Manuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.