Skip to Content
0

SAPUI5 Data model issue using multiple views

Oct 18, 2016 at 06:09 PM

75

avatar image
Former Member

Hi Experts,

I'm developing a fiori application with the two views by using fiori work list template.

Work list view has a table and it is filled with Entityset "A" and then Object view also have another item table and data is populated with different model and Entityset "B".

When i navigate from first view Work list to object view i got the right path via oEvent.

Ex:

with this i manage to fetch the Item details and populated Item table. up to here everything is fine.

Problem is when i click on item table, it is still showing previous path like below.

Based on the Item click event i want to fetch different details and show popup.

Can someone help me ? what could be the reason ? i may need to destroy or Clear model or event listener.

Thanks in advance.

Cheers,

San.

screenshot-3.png (24.7 kB)
screenshot-4.png (26.8 kB)
10 |10000 characters needed characters left characters exceeded

Please add your code, the model, and what entity you are trying to show. Without this information we can only guess.

Regards,

Jamie

SAP - Technology RIG

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

2 Answers

avatar image
Former Member Oct 19, 2016 at 12:01 AM
0

Hi Jamie,

Thank you for your help.

Ref Code:

View 1 XML:

<Table id="table" width="auto" items="{ path: '/EtyClaimApproverSet', sorter: { path: 'Clttx', descending: false } }" noDataText="{worklistView>/tableNoDataText}" busyIndicatorDelay="{worklistView>/tableBusyDelay}" growing="true" growingScrollToLoad="true" updateFinished="onUpdateFinished" >

Continue...

<items> 
<ColumnListItem type="Navigation" press="onPress"> 
<cells>
<ObjectIdentifier title="{Ename}"/>

Continue ....

View 1 Controller:

		onPress: function(oEvent) {
			debugger;
			// The source is the list item that got pressed
			switch (oEvent.getSource().getBindingContext().getProperty("Clmty")) {
				// Medical Claims
				case "01":
					this._showMedical(oEvent.getSource()); 

Here i'm able to read correct binding context via oEvent.

View 2 XML:

<Table id="transportItems" width="auto" items="{itemModel>/data}" updateFinished="onListUpdateFinished"
noDataText="{i18n>detailLineItemTableNoDataText}" busyIndicatorDelay="{detailView>/lineItemTableDelay}" class="sapUiResponsiveMargin">
<columns>
<Column >
<Text id="id_Trvdt" text="Travel Date"/>
</Column>

Continue..

<items>
<ColumnListItem>
<cells>
<Text text="{itemModel>Dayin}"/>
<ObjectNumber number="{itemModel>Ovdur}"/>
<Button id="idClockBt" icon="sap-icon://sys-find" press="onPopover"/>

Continue...

Controller:

onPopover: function(oEvent) {
debugger;
var sOvtdt = oEvent.getSource().getBindingContext().getProperty("Ovtdt");
var that = this;

This oEvent still returns View 1 Path not {itemModel>/data} related path..

Hope it helps you to understand my logic..

Cheers,

San.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 20, 2016 at 01:28 AM
0

Hi All,

What I have noticed is for 2nd table I have used JSON format, with this oEvent is not showing the correct results, so I have changed it to ODATA, after that it is working fine.

when i get time I'll get more details and then I'll update this thread.

Thank you.

Cheers,

San.

Share
10 |10000 characters needed characters left characters exceeded