docs

Parameters

When creating a binding, you can provide a parameter map which can contain the following:

The binding’s OData query options are combined with the query options passed to the OData V4 model; the binding’s query options overwrite model query options with the same name. The resulting query options are appended to each data service request by this binding. The following query options are supported; all others are not allowed and lead to an error:

The query option $count must be specified as a boolean value with true or false. All other query options can be specified with a string value. In addition to strings, the following alternatives are possible:

Example: Binding with parameters in JavaScript


oView.byId("SalesOrderTable").bindItems({
    path : "/SalesOrderList",
    parameters : {
        "$count" : true,
        "$expand" : {
            "SO_2_SOITEM" : {
                "$orderby" : "ItemPosition",
                "$select" : ["ItemPosition", "Quantity", "QuantityUnit", "SalesOrderID"]
            }
        },
        "$filter" : "BuyerName ge 'M'",
        "$orderby" : "GrossAmount desc",
        "$select" : ["BuyerName", "CurrencyCode", "GrossAmount", "Note", "SalesOrderID"]
    }
});

Example: Binding with parameters in an XML view ($select and $expand values as string)


<Table growing="true" growingThreshold="5" id="SalesOrders"
    items="{
            path : '/SalesOrderList',
            parameters : {
                $count : true,
                $expand : 'SO_2_BP',
                $filter : 'BuyerName ge \'M\'',
                $orderby : 'GrossAmount desc',
                $select : 'BuyerName,CurrencyCode,GrossAmount,Note,SalesOrderID'
            },
        }">

Example: Binding with parameters in an XML view ($select and $expand values as object)


<Table growing="true" growingThreshold="5" id="SalesOrders"
    items="{
            path : '/SalesOrderList',
            parameters : {
                $count : true,
                $expand : {
                       'SO_2_SOITEM' : {
                               '$orderby' : 'ItemPosition',
                               '$select' : ['ItemPosition','Quantity','QuantityUnit','SalesOrderID']
                       }
               },
                $filter : 'BuyerName ge \'M\'',
                $orderby : 'GrossAmount desc',
                $select : ['BuyerName','CurrencyCode','GrossAmount','Note','SalesOrderID']
            },
        }">

changeParameters allows to change, add, or delete OData query options. This does not apply, however, to binding-specific parameters that start with $$.

The parameters are changed according to the given map of parameters: Parameters with an undefined value are removed, the other parameters are set, and missing parameters remain unchanged. Change, add or delete is possible at the same time. The binding is refreshed as soon as the parameter changes are applied.

Example: Change binding parameters in JavaScript


oView.byId("SalesOrderTable").getBinding("items").changeParameters({
    "$search" : '"mountain bike"',
    "$filter" : undefined
});