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

Re: Binding types

$
0
0

Did you read the help documents on each binding type?

 

Binding Types - User Interface Add-On for SAP NetWeaver - SAP Library

 

Think  of it like this...

 

Property binding - you set an "variable" to control the property of an object...for example, you might have a property "visibility" with values "show" (1) or "hide"(0).....but you don't want them "hardcoded", you want them to come from some "variable" you dynamically set....you might ...

 

oTextField.bindProperty("visibilty", "/myobject/visible");

 

or

 

oTextField.bindProperty("visibilty"", {

     path: "/myobject/visible",

     type: new sap.ui.model.type.Integer()

});

 

Element binding - this is as the name says binding DIRECTLY to a SINGLE element...so say you have a group of fields in your layout and you want all the data to come from you "employee" object....you bind your "employee" object to your layout and then for your fields, you can set their values to values from your employee object....so if you had say employee "first_name", you could easily say :

 

oMatrixLayout.bindElement("/employee");

oMatrixLayout.createRow(

new sap.ui.commons.Label({text: "Name:"}),

new sap.ui.commons.TextField({value: "{first_name}"})

);

 

Aggregation binding - is binding to create "child" objects of an element....easiest way to think of this is if you have a "table" element and you want to create "rows"....you have a row "template" for your "aggregation" (data of each row) so when you bind you aggregation to your table, it takes each on and creates a row in the table (child of table) based on your template.

 

Makes sense?


Viewing all articles
Browse latest Browse all 3316

Trending Articles



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