cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Binding

nishantbansal91
Active Contributor
0 Kudos

Hi Team,

I have some basic question regarding binding the data .

1. When we need to use / while doing binding. 

"{/ebeln}" or "{ebeln}". What  is the difference between both statement.

2. Is there any binding difference for the same service if i am using the different types of view?

3. var page  = sap.ui.page( );

   var page = new sap,ui,page() 

What is difference between above 2 statements.


Thanks

Nishant Bansal

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

>>1. When we need to use / while doing binding. {/ebeln}" or "{ebeln}". What  is the difference between both statement.

first is global, second - relative

>>2. Is there any binding difference for the same service if i am using the different types of view?

what do you mean by binding difference ?

>>3. var page  = sap.ui.page( )  var page = new sap,ui,page() What is difference between above 2 statements.

first - method call, second - creating an object

nishantbansal91
Active Contributor
0 Kudos

Dear Maksin

Can you please elaborate this line.  .

>>1. When we need to use / while doing binding. {/ebeln}" or "{ebeln}". What  is the difference between both statement.

first is global, second - relative

1 If i have local model (model defined in the component itself (e.g. JSON model ))then i will go for (ebeln).

2, if we have global model then i  will go for {/ebeln}.


Please correct me if i am wrong.

2.Is there any binding difference for the same service if i am using the different types of view?

Suppose i am taking 2 view one is java script and second in XML and used the same table in both view.

is there any binding changes in both view.

3.

For the third while creating the project in Eclipse  System create one default file.

can you please explain the use of below line.

var page = sap.ui.view({id:"idmain1", viewName:"jsonmodel.main", type:sap.ui.core.mvc.ViewType.JS});

Thanks
Nishant

monalisa_biswal
Contributor
0 Kudos

Hi Nishant,

For your query regarding data binding, check following link

Data Binding: Getting Started - User Interface Add-On for SAP NetWeaver - SAP Library

See how binding is done for oRowTemplatee at end.

Usually when you are doing aggregation binding. e.g. to a table element

You will specify binding for a column without "/", if the field is immediately below the collection.

Table.setModel(oModel);

oTable.bindRows("/modelData"); // Bind collection to the table rows

oTable.addColumn(new sap.ui.table.Column({

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

                template: new sap.ui.commons.TextField({editable:false}).bindProperty("value", "designation")

              

            })); // No '/'

Hope it helps!

Thanks,

Mona

Answers (2)

Answers (2)

karthikarjun
Active Contributor
0 Kudos

Hi Nishanth,

1. sap.m.page - It is a class in SAP UI5. Which mean you can invoke this class property in your SAP UI5 code.

2. {/ebeln} - Collection of record to bind under list

{ebeln}  - Bind only one record to Element

Thanks,

Karthik A

former_member182915
Active Contributor
0 Kudos

Hi Nishant,


3. var page  = sap.ui.page( );

   var page = new sap,ui,page()

What is difference between above 2 statements.

Gives a  "Uncaught TypeError: sap.ui.page is not a function" Error at runtime .