cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind Selected table row content to the form in next page?

Former Member
0 Kudos

Hi,

I am new to SAPUI5, have a requirement.

In view1 need to display the table, on selection of any one row navigate to the another view ( view2) and display contents in form and need to input enable for certain fields and after changes save to database.

I can able to display the table and upon selection of table row navigating to view2, but having problem that not able to bind the contents to the form.

I am using the XML views.

Can anyone help me how to bind the context.

Thanks,

prakash.

Former Member
0 Kudos

Hello Friends,

Any Advice or Help on this requirement would be greatly appreciated..

Thanks,

Prakash.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jun,

Getting the following error.

Table.controller.js:89 Uncaught TypeError: Cannot read property 'getBindingContext' of undefined

Here is the code

var oContext = oEvent.getParameter("rowContext");

var oModel = oContext.getBindingContext().getObject();

var page = sap.ui.view({

/viewName : "Demo.Update", type : sap.ui.core.mvc.ViewType.XML

}); app.addPage(page2); app.to(page2, "flip");

Thanks,

Prakash.

junwu
Active Contributor
0 Kudos

remove

var oModel = oContext.getBindingContext().getObject();

Former Member
0 Kudos

Just removed the line as you said, but the data is not binding to the oContext.

Simply going to the second view.

junwu
Active Contributor
0 Kudos

page2.setBindingContext(

oContext

)

junwu
Active Contributor
0 Kudos

from the selected row, get the bindingcontext, set the same context to your form.