on 05-19-2014 3:16 PM
Hello,
I have a split app with a list and a detail controller. I click on a list item and the detail opens with:
Master: List item handle
var context = evt.getParameter("listItem").getBindingContext();
this.nav.to("Detail", context);
The nav.to is defined in the App.controller.js - everything is based on DJ Adams Fiori like apps in 10 exercises.
On the detail I have a button with a certain event handler:
oModelMS.callFunction('UpdateWorkStepStatus', 'GET', updateData, null, fnSuccess, fnError) ;
and the fnSuccess is like:
oModelMS.refresh(true);
But then only the Master updates and not the detail view... How can I trigger that? If I manually click on the list item it shows the updated dataset...
In the Component.js I have set it to:
var uri = "http://localhost:32006/JsonOdataService.svc";
var oModelMS = new sap.ui.model.odata.ODataModel(uri);
sap.ui.getCore().setModel(oModelMS, "odata");
oView.setModel(oModel);
and the Objectheader has just:
<firstStatus>
<ObjectStatus
text="{
path: 'Status',
formatter: 'sap.ui.demo.mySMUI.util.Formatter.statusText'
}"
state="{
path: 'Status',
formatter: 'sap.ui.demo.mySMUI.util.Formatter.statusState'
}" />
</firstStatus>
The binding with odata>Status doesn't work...
Here I tried to upload the source-code:
The App.controller.js handles the navigation, and I have a nested list: Master -> SubMaster, on the submaster I click a line-item which navigates to the Detail-view.
Code is very work in progress:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<entry>
<title type="text"/>
<updated>
<author>
<link rel="edit" title="tabWorkstep_Status" href="tabWorkstep_Status(LOT_ID='CB01-1-1',ORDER=1,SITE_ID='MILANO',SUBORDER=0,WORKCENTER_ID='PLANTSOUTH',WORKPLACE_ID='ASSEMBLE1',WORKSTEP_ID='ASSTORSO')"/>
<category term="DataServicesJSONP.tabWorkstep_Status" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<d:SITE_ID>
<d:WORKCENTER_ID>
<d:WORKPLACE_ID>
<d:WORKSTEP_ID>
<d:ORDER m:type="Edm.Int32">
<d:SUBORDER m:type="Edm.Int32">
<d:Status>
<d:Unit_of_Measurement>
<d:Quantity m:type="Edm.Decimal">
<d:Open_Quantity m:type="Edm.Decimal">
<d:Scrap_Quantity m:type="Edm.Decimal">
<d:Mat_ID>
<d:User_ID m:null="true"/>
<d:WORKINSTRUCTION_ID>
</entry>
Beleive or not it updated object header for me
What exactly do you display in detail view? Does it have binding? You pass binding context, as I see in App.controller 'to' method sets binding context to the whole page:
page.setBindingContext(context);
but are controlls on detail view bound to smth?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, the controls are bound like and the master-detail navigation works.
<ObjectHeader
title="Lot ID: {LOT_ID}"
number="{SITE_ID}"
numberUnit="Workstep: {WORKSTEP_ID}" >
</ObjectHeader>
When I click on the button the detail view doesn't refresh, but the master does... There must be something missing... Hm... A tiny little step...
When - after the button click - I click on another list item and then to the old one again, then the detail view is updated...
Somehow I must say that the view should "refresh" the data... But it is strange, thought because of "binding" it could be done automatically...
Hello Denise,
I assume that your Data is already updated cause you said it refreshes after you click another item.
You can try to manually rerender the Content of your Detail View inside your Detail Controller by calling
oController.getView().rerender();
This should trigger a manual refresh of the whole Detail Page and you should be able to see your updated Content.
I had a similar problem where the Detail View Content was not refreshing after selecting a new item on the Master View.
I don´t know if this is the expected way to do it but this should work.
best regards
Florian
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.