on 04-14-2019 4:38 AM
Hi UI5ers,
I am trying to use settimeout method in my view controller. But the timeout method is never called.
Any reason why JS native methods cannot be used in Ui5? Or Am I using it wrongly?
Thanks,
Bhaskar
Hi Bhaskar B,
Instead of setTimeout, use the SAP provided functions:
jQuery.sap.intervalCall(500, this.hidePanelAgain, this)
https://ui5.sap.com/1.56.15/#/api/jQuery.sap/methods/jQuery.sap.intervalCall
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
It worked, thanks!
onItemSelected: function(oEvent)
{
Msg.show("Item Selected");
var sPath = oEvent.getSource().getBindingContext().getPath();
var oProductDetailPanel=this.byId("productDetailsPanel");
oProductDetailPanel.bindElement({path:sPath});
this.byId("productDetailsPanel").setExpanded(true);
//setTimeout(this.hidePanelAgain, 3000);
jQuery.sap.intervalCall(3000, this , "hidePanelAgain", [this]);
},
hidePanelAgain: function(passedthis)
{
passedthis.byId("productDetailsPanel").setExpanded(false);
}
One question though: setTimeout will never work in the controller or even HTML page?
Thanks,
Bhaskar
User | Count |
---|---|
67 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.