Skip to Content
0

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

Feb 13 at 06:47 PM

53

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
Former Member

Hello Friends,

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

Thanks,

Prakash.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Feb 14 at 03:34 AM
0

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.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

remove

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

0
Former Member

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

Simply going to the second view.

0
Former Member

page2.setBindingContext(

oContext

)

0
Jun Wu Feb 13 at 08:17 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded