Sap

Binding Options for Fiori Models

PROPERTY BINDING

When the /ifscode binding is an absolute binding path

/bankDetails/AccountNum is a relative binding path.

We used property binding because the property is the text’s property.

ELEMENT BINDING

In element binding, we bind the property we will use to the element itself. This way, we don’t need to rewrite the model again and again in elements such as text and input. Therefore, we can bind in a relative way instead of an absolute way. We use binding syntax. After binding, we bind the property with the syntax “{/PropertyName}”. We don’t need to call the variables inside that property anymore. In elementary binding, the / is not used.

Other variables inside the JSON model are called this way.

We can bind more than one using a comma.

AGGREGATION BINDING

Aggregation Binding in SAPUI5 allows us to bind multiple data items for a particular property of a UI5 control. This allows a model to create and update elements in one or more controls using a specific data set.

Aggregation Binding is used to bind a property of a control to a specific model. This model can be an array or collection containing multiple items. Aggregation Binding creates each item of an array or collection as an instance for the relevant property of the control.

If we want to show our data in table or list format, we can use aggregation binding.

As many data as there are in JSON, that many data will come.

For items, “{ModelName>/PropertyName}” is used, and for objects, “{ModelName>FieldToBind}” syntax is used.

EXPRESSION BINDING

It is used to give a condition to the binding.

It is a feature used to perform data binding operations in SAPUI5 applications. This feature can be used to calculate data from a specific model using an equation or formula and bind this calculation to an interface element.

Expression Binding can be used in XML or JavaScript view files. This feature offers a more flexible approach than simple data binding methods that directly determine the data to be displayed in user interface elements.

After the =$ sign, “{ModelName>FieldName} === FieldValue ? ‘Active’ : ‘Expired’, is used for the beginning.

We also used the same structure to set the colors.

We make use of “${ModelName>FieldName.toUpperCase()}” to make the letters uppercase when printed on the screen.

To read the property, / is required.

To define the model globally, we said this._setGlobalModel() in onInit.

We create that function in the project.

About Author

I have a Bachelor's degree in Management Information Systems from Sakarya University, where I learned the fundamentals of information technology, business analysis, and project management. I have also worked as an Oracle HR Cloud Technical Consultant at Athena Information Solutions. Currently working as a SAP ABAP and Fiori Consultant

No Comments

    Leave a Reply