300+ TOP Sap Ui5 Interview Questions and Answers

Q1. Name Some Standard Controller Hooks In Sapui5?

  • onInit – an event that is called when the view and the controller are instantiated
  • onExit – an event that is called when the view and the controller are destroyed

Q2. What Is Metadata Annotations?

The service metadata document describes the structure of all resources in the service. This structural metadata makes it easy to understand a service. We can explore service metadata at the address “$metadata” relative to the service root.

Q3. What Is The Purpose Of The “static Area” In The Dom?

To display dialogs and popup controls over the application UI

Q4. What Are Fragments Primarily Used For?

To make parts of your view reusable

Q5. How Can You Compose Filters In Sapui5?

  • By creating multiple filters and concatenating them either with AND or OR
  • By creating a single sap.ui.model.Filter object and specifying a path, an operator, and up to two values

Q6. What Do You Need If You Want To Bind A List To Data In Your Jsonmodel?

  • An array with the data in the JSONModel that you want to bind to the list
  • A template list item to be cloned
  • A bound list control

Q7. What Are Common Metadata Annotations?

Following are some of the service metadata annotations which are common and a front end developer must know these in order to understand the service and integrate it:

  • edm:EntityContainer
  • edm:EntitySet
  • edm:EntityType
  • edm:Property
  • edm:NavigationProperty
  • edm:AssociationSet

Q8. Which Of The Following Namespaces Can Be Used In The Manifest.json File?

  • sap.ui5
  • sap.app
  • sap.ui

Q9. Which Options Are Available In Sapui5 If You Want To Create A Custom Control?

  • Extend an existing control with your own features.
  • Create a composite control that reuses existing controls internally.
  • Extend the sap.ui.core.Control base class and build a new control.

Q10. What Is A Component Within Sapui5?

An independent and reusable part that can be used to structure SAPUI5 applications

Q11. What Is Sinon.js?

A standalone unit testing library for JavaScript that provides spies, stubs, and mocks

Q12. How Do You Register A Unit Test In Qunit?

Call QUnit.test() in your test code with a speaking test description and a callback that contains at least one assertion.

Q13. What Are Semantic Colors In Sapui5?

They are representations of states such as success, warning, and error.

Q14. What Happens When You Instantiate A Dialog From A Single-rooted Fragment?

  • The dialog instance is returned when you invoke the fragment factory.
  • The dialog is instantiated but not displayed.

Q15. What Is The Correct Sequence Of Called Functions / Handled Callbacks Of The Odata Model In The Add Controller?

on metadataLoaded – createEntry – submit – on success

Q16. Which Property Of The Routing Configuration In The Manifest.json File Should You Use To Automatically Display A Target That Is Not Found?

Bypassed

Q17. What Information Can Be Stored Inside The Manifest.json File Of Your App?

  • Content densities
  • Root view
  • Models of your app

Q18. What Is The Role Of The Application Template In The Development Process?

To generate an initial set of files that serve as the starting point for the development of a productive application

Q19. Which Control Adapts Its Appearance On Touch Devices?

The PullToRefresh control: It is represented as a simple button on non-touch devices, but the user needs to pull the page content down on touch devices to refresh it.

Q20. What Is The Benefit Of Data Binding Within Sapui5?

SAPUI5 uses data binding to bind two data sources or information sources together to keep them in sync. This means: All changes in one source are also reflected in the other one.

Q21. What Are Sapui5 Fragments?

Fragments are very light weight UI controls. Fragments are not completely like views but they act like a view. Fragments are defined similar like views and are names like “Fragment.fragment.xml“.

Q22. Which Of The Following Sequences Of Steps Do You Use To Assemble The Url To Access Your Odata Service’s Metadata?

  • Run your app from SAP Web IDE and copy its URL into a new browser tab.
  • In your app’s manifest.json file, go to “services”, copy the URI, and use it to replace the file path in the URL from Step @
  • Append “/$metadata” and press enter.

Q23. What Is Component?

It is the first point of the application, it serves as an index, which encapsulates all the application details, like  view names, routing details, main view, applications type(Full Screen or SplitApp), application service configuration etc.

There are 2 types of compponents:

  1. Faceless components: Mainly without UIs, Used for business logic and helper methods e.g. Formatters.
  2. UI Component: typically component.js file which is made by extending sap.ui.core.UI Component class.

 

Q24. What Is The Best Practice For Showing Or Hiding An Sapui5 Control At Runtime?

Set the “visible” property of the control to “true” or “false”.

Q25. How Would You Add An Icon From The Sapui5 Icon Font To A Button In An Xml View?