step 1 − to create a new project in ui5 developer studio, go to file → new → project.
step 2 − enter the name of project, target device, and create an initial view.
step 3 − enter the view name and view type in the next window and click next.
step 4 − in the last window, you see the project summary. it shows you the project properties. click the finish button to create the project.
step 5 − you will be prompted to switch to java ee perspective. click yes and it will open a new ui5 project window with an initial view - jsview.
step 6 − now to add a shell to this view, you can use the library sap.ui.ux3.shell().
step 7 − as shell is not part of sap.ui.commons, you need to add sap.ui.ux3 library. you can add additional libraries to data-sap-ui-libs.
to run an application, you have two options −
- run on server
- run on webapp
run on server is recommended as it has a fixed port and it is not like run on webapp with one-time random port.
sap ui5 ─ configuration
as shown in the following table, you can define various configuration attributes in sap ui5 −
core functions
the core functions in sap ui5 are as follows −
sap.ui.getcore() − this is used to get a core instance.
sap.ui.getcore().byid(id) − this is used to get an instance of ui5 control created with id.
sap.ui.getcore().applychanges() − this is used to carry out and render the changes for ui5 controls immediately.
jquery.sap.dombyid(id) − this is used to get any html element with id. if there is a ui5 control with id, the element returned is top most html element of ui5 control.
jquery.sap.byid(id) − this is used to return jquery object of dom element with specified id.