cancel
Showing results for 
Search instead for 
Did you mean: 

How to show data in detailFragment with other entity?

former_member357192
Participant
0 Kudos

I have SAPUI5 application project with Master-Detail template and I have a service which has two entities WO1 and WO2. Both are linked with OrderNumber.

Master contains data from WO1 with primary key OrderNumber.

Detail contains table , you can see at bottom showing columns like operation,description,status and assignedTo. The data comes from WO2 based on orderNumber, when user selects order from Master. (Note: One order contains multiple operation)

The Fragment which contains table in Detail section is created in other file.

How can I get data in fragment table based on order selected in master.

Following is the Fragment code

<core:FragmentDefinition height="100%" width="100%" xmlns:core="sap.ui.core" xmlns:f="sap.ui.layout.form" xmlns:l="sap.ui.layout"

    xmlns="sap.m">

    <Panel>

        <ObjectHeader number="" numberUnit="Items" title="{Orderid} - {ShortText}">

            <ObjectAttribute text="{Equipment} - {EquipmentDesc}" title="Equipment"/>

            <ObjectAttribute title="Start" text="{StartDate}"/>

            <ObjectAttribute title="End" text="{FinishDate}"/>

            <ObjectAttribute title="Planner Group" text="{PlanGrpDesc}"/>

            <ObjectAttribute title="Work Center" text="{WorkCenterDesc}"/>

            <ObjectAttribute title="Notification" text="{NotifDescription}"/>

            <ObjectAttribute  title="User Status" text="{Userstatus}"/>

        </ObjectHeader>

      

        <Table id="idProductsTable"

        inset="false">

  

        <columns>

            <Column

                width="12em">

                <Text text="Operation" />

            </Column>

            <Column

                minScreenWidth="Tablet"

                demandPopin="true">

                <Text text="Description" />

            </Column>

            <Column

                minScreenWidth="Tablet"

                demandPopin="true"

                hAlign="Left">

                <Text text="Status" />

            </Column>

            <Column

                minScreenWidth="Tablet"

                demandPopin="true"

                hAlign="Left">

                <Text text="Assigned To" />

            </Column>

        </columns>

        <items>

            <ColumnListItem>

                <cells>

                    <Text

                        text="{Activity}" />

                    <Text

                        text="{Description}" />

                    <Text

                        text="{SystemStatusText}" />

                    <Text

                        text="{WorkCntr}" />

                </cells>

            </ColumnListItem>

        </items>

    </Table>

    </Panel>

</core:FragmentDefinition>

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

<Table id="idProductsTable" items="{PathToEntitySetForProducts}"       inset="false">

PathToEntitySetForProducts if it is relative to parent


or


/PathToEntitySetForProducts if it is absolute (no navigation )

former_member357192
Participant
0 Kudos

yes, I am able to show data using

<Table id="idProductsTable"

        items="{

            path: '/WO2'',

            sorter: {

                path: 'OrderNumber'

            }

        }"

        inset="false">

But, I want to filter it, as shown below, where '000040000042' comes from WO1. How can I do this.

<Table id="idProductsTable"

        items="{

            path: '/WO2?$filter=OrderNumber eq '000040000042'',

            sorter: {

                path: 'OrderNumber'

            }

        }"

        inset="false">

former_member182372
Active Contributor
0 Kudos

you would need to define a navigation link between WO1 and WO2 and use just

ble id="idProductsTable"

        items="{

            path: 'WO2'',

so a path would be linke

/WO1(Key='key' ... )/WO2

former_member357192
Participant
0 Kudos

I have tried that but didn't worked.

What I want is when I select from Master view I want to update table (which is in details fragment view) based on selection

former_member185414
Active Contributor
0 Kudos

Either Create a navigation as suggested by Maksim and pass the order number in hash(url) or you can create global variables(without Var variables and put values in them) and use these values as filters in the binding of the data (generally pass them as $filter values to OData).

BR.