Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Syntax of 'Set' Functions

Hi everyone. I have been trying to create a view using 'SET' functions, but no luck. The code below works.

var lco_View = new sap.ui.view(

{    id: "Tasks",

    viewName: "zbc_ui5_app01.Tasks",

    type: sap.ui.core.mvc.ViewType.JS



What is the equivalent using 'Set' Functions:

var lco_View = new sap.ui.view("Tasks");




When I use this code, it gives me an error that 'View type not defined'. How do I get the syntax for 'Set' functions, is there a general rule of thumb. I cannot get the details in the API as well. Or alternatively, can i use the 'setProperty' Function?

Thanks in advance guys.

PS: there is no API reference for node 'SAP.UI.VIEW', is this an alias for another class?

Former Member

Hi Jibran,

Here I've a working example:,output

Think you have to switch the id and the name as in my example. Also used sap.ui.jsview instead of sap.ui.view.

Kind regards,


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question