on 10-23-2013 11:32 AM
Hello All.
I am writing my first application using the SAPUI5 toolkit. I have created a list with som detail data, and want to display a graph (using the sap.makit.* controls).
My first problem is to catch an event with some details of the record, that has been selected.
I am using code like this:
oImage.attachPress({currID:"EUR"}, this.onGraphRequest);
I am using an image in the list as the control for the user to press.
This part is working fine.
My eventhandler looks like this:
onGraphRequest : function(oEvent) {
var p = oEvent.getParameter("currID");
}
But I am not seeing the value "EUR".
Can anybody please help ?
Søren Hansen
Hi Søren,
custom data which is given when the event handler is registered is not mixed in to the regular parameters, but it is available as an additional second parameter of the event handler function. So you can write it like this:
var onGraphRequest = function(oEvent, oData) {
var p = oData.currID;
alert("Parm value: " + p);
}
The reason for this is that you can not only pass name-value maps but any kind of data objects, including things like functions, Controls, etc. Those could not be merged with the parameters.
Regards
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.