on 10-22-2015 7:22 PM
Hi All,
could you please say how to trigger two functions from single button press in SAP UI5 button [Requesting in xml view].
Controller.js
onPress1: function () {
console.log( " 1 Pressed");
},
onPress2: function () {
console.log( "2 Pressed");
},
View.xml(following is working when seperate buttons)
<Button press="onPress1"/>
<Button press="onPress2"/>
View.xml(following is Not working)
<Button press="onPress1 ; onPress1"/>
could you please say where I am going wrong...
Note:for my scenario function2 calling inside function1 will not workout.
Could you please suggest any other solution for XML view.
Thanks in advance,
regards,
Abhiram.
How about this?
In xml
<Button id = "buttonid" class = "buttonclass" ></Button>
In controller
onAfterRendering : function()
{
var id = this.getView().byId("buttonid").sId;
$("#" + id).bind("click" , function () { alert("function one")});
$(".buttonclass").bind("click" , function () { alert("function two")})
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
why dont create
onPress12 : fucntion()
{
this.onPress1();
this.onPress2();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.