Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2720

Re: Anyone have used sap.ui.model.odata.v2.ODataModel ?

$
0
0

is it not working by using below code?


Binding-specific Parameters

 

The OData protocol specifies different URL parameters. You can use these parameters in bindings in addition to the parameters described above:

  • Expand parameter

    The expand parameter allows the application to read associated entities with their navigation properties:

     oControl.bindElement("/Category(1)",{expand:"Products"});  oTable.bindRows({ path:"/Products", parameters:{expand:"Category"}});

    In this example, all products of "Category(1)" are embedded inline in the server response and loaded in one request. The category for all "Products" is embedded inline in the response for each product.

  • Select parameter

    The select parameter allows the application to define a subset of properties that is read when requesting an entity.

     oControl.bindElement("/Category(1)",{expand:"Products",select:"Name,ID,Products"});  oTable.bindRows({ path:"/Products", parameters:{select:"Name,Category"}});

    In this example, the properties Name, ID and ofCategory(1) as well as all properties of the embedded products are returned. The properties Name and Category are included for each product. The Categoryproperty contains a link to the related category entry.

  • Custom query options

    You can use custom query options as input parameters for service operations. When creating the aggregation binding, specify these custom parameter as follows:

     oTable.bindRows({ path:"/Products", parameters:{ custom:{ param1:"value1", param2:"value2"}},template: rowTemplate });

    If you use bindElement, you can specify custom parameters as follows:

     oTextField.bindElement("/GetProducts",{ custom:{"price":"500"}});

Viewing all articles
Browse latest Browse all 2720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>