-1

Demo - http://jsbin.com/bukanagobu/1/edit

The problem is when i click on one of the item, it navigates to the next view but it is not displaying the firstname and lastname.

I have saved the model as 'data'.

Can anyone help me in finding the error ?

Abhishek Saha
  • 2,564
  • 1
  • 19
  • 29
  • Does this answer your question? [getBindingContext() Returns undefined](https://stackoverflow.com/questions/36913868/getbindingcontext-returns-undefined) – Boghyon Hoffmann Jul 13 '21 at 16:55

1 Answers1

0

You have made two mistakes in your code:

  • When getting the binding context upon clicking an entry in the list, you must specify the named model name 'data':

    var oBindingContext = evt.getSource().getBindingContext("data"); 
    // if using named models, specify which model you want to use 
    
  • Also, when setting the binding context to the detail view, you must also set the model name to 'data':

    page2.setBindingContext(oBindingContext, "data"); 
    // also, name the context model to 'data' 
    

See the updated JSBin here : http://jsbin.com/fehoqu/1/edit?html,output

Benedikt Kromer
  • 711
  • 6
  • 22
Qualiture
  • 4,900
  • 7
  • 27
  • 38