Skip to Content

No data in detail view when using named oModel

I have started with a master-detail application template within WebIDE. We have a need to have multiple oData services for a particular use case. I've seen some examples in the older coding methods using named oModel. I thought a good first step would be to take a working application based off the template and simply name the oModel to get that working.

It is filling my Master view just fine. However, it is the detail view that isn't populating.

The name of my oModel is mainModel and I have made sure that in the Detail.view.xml that everything is referenced that way such as {mainModel>MAN_NAME}. This is the same way I am referencing them in the Master.view.xml and again that is populating.

I don't get any data in the Detail.view.xml, through debugging I can see that even within the bindView method of the Detail.controller.js the data is coming and is being bound. Then the fireDetailChanged function is called, the entity path is correct.

But there is no data on the screen. Can anyone point me in a direction to look? I have made sure that I have changed the any references to getModel() to getModel("mainModel") and the same with any references to getBindingContext().

Any thoughts on where to look would be appreciated.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 11, 2015 at 07:56 PM

    Can you post you code so I can have a clear vision of what is wrong?

    Add a comment
    10|10000 characters needed characters exceeded

    • Teobaldo, thanks for your reply.

      Looking in the debug tools when the application is loaded (Ctrl+Alt+Shift+S), I see that there is nothing in the Binding Infos for the detailPage node.

      Here is the project in our git lab:

      Roger Beach II / MSS_Lane_POC | GitLab

      What we found was that if in the Detail.controller.js we changed the bindView function so that in the second line we changed from:




      then it works but is this the correct approach?

      Edit: Apparently I was posting as Jamie was replying. His guidance solved the issue. Thank you.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.