w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
SAPUI5: Binding controller properties to the view

UI5 follows the M-V-C paradigm and event handler is not part of data model.

The correct way to do data binding is as following:


The onClick is defined as a function in the controller not in the data model.

<custom-button id="btn" value="{/value}"
disabled="{/disabled}" click="onClick" />


sap.ui.core.mvc.Controller.extend('...', {

    buttonProps: new sap.ui.model.json.JSONModel({
        value: 'cheese',
        disabled: 'disabled'

    onInit: function() {

    onClick:function(oEvent) {



© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.