I have sample text element on view. How can I hide them for example after delay of 3 seconds? Usage of setTimeout() doesn't work.
Here is my view code.
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:l="sap.ui.layout"
controllerName="setvisible.Index" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Title">
<content>
<Text id="sampleText" text="Test" visible="true"/>
<Button id="hide" text="Hide" press="hide"/>
</content>
</Page>
</core:View>
And this is my controller code.
sap.ui.controller("setvisible.Index", {
hide: function(oEvent) {
setTimeout(showElem, 3000);
function showElem() {
this.byId("sampleText").setVisible(true);
this.getView();
}
}
});
Error is Uncaught TypeError: undefined is not a function.