on 10-22-2015 3:28 PM
Hello,
I'm trying to find out how do I check if a given control has a method I look for.
For example, I have 2 controls:
var oControl1 = new sap.m.DateTimeInput({
id: "control1",
type: "DateTime"
});
var oControl2 = new sap.m.Input({
id: "control2",
type: "Number"
});
The first control has getDateValue() method, which the second one doesn't.
I want to check if the control I call using dynamic ID has a specific method, like (this is not a real code, it's how I want to check):
if(sap.ui.getCore().byId("<control's ID here>").hasMethod("getDateValue")){
alert("Hurray!");
}
Is there a way do accomplish this?
Thank you.
or even better
if (typeof sap.ui.getCore().byId("<control's ID here>").getDateValue == 'function') {
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
javascript is functional language
so as easy as
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.