Code Monkey home page Code Monkey logo

vaibhavmojidra / sap-ui5---demo-expression-binding Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 63 KB

SAP UI5 provides Expression Binding as an enhancement of the SAPUI5 binding syntax, which allows for providing expressions instead of custom formatter functions.

Home Page: https://vaibhavmojidra.github.io/site/

License: MIT License

JavaScript 52.25% HTML 47.75%
javascript javascript-es6 mojidra sap sap-ui5 ui5 vaibhav vaibhav-mojidra vaibhavmojidra

sap-ui5---demo-expression-binding's Introduction

SAP UI5 Demo Expression Binding

SAP UI5 provides Expression Binding as an enhancement of the SAPUI5 binding syntax, which allows for providing expressions instead of custom formatter functions. This saves the overhead of defining a function and is recommended in cases where the formatter function has a trivial implementation like comparison of values. Expression binding is especially useful in the context of SAPUI5 XML templating where XML views with templating are preprocessed so that the SAPUI5 controller is a natural place to put custom formatter functions that are not available.

Code Explaination

Refer to /webapp/controller/InvoicesList.controller.js

The ObjectListItem tag is used to define the properties of each item in the list. The numberState property of the ObjectListItem tag is used to define the state of the number field based on the value of the ExtendedPrice property of the invoice model.

The expression binding syntax is used to define the value of numberState. The expression is evaluated at runtime and the result is used to set the state of the number field. The expression is defined as follows:

{=${invoice>ExtendedPrice}>10?'Error':'Success'}

This expression checks if the value of ExtendedPrice is greater than 10. If it is, then the state of the number field is set to Error. Otherwise, the state is set to Success.


Vaibhav Mojidra - 1.jpeg

sap-ui5---demo-expression-binding's People

Contributors

vaibhavmojidra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.