cancel
Showing results for 
Search instead for 
Did you mean: 

Display columns of exapnded entity in smart table

Former Member
0 Kudos

I am using a smart table and want to display columns from two entities which are linked through association.

In the smart table I have set the entity set of the main entity:

entitySet="TechnicalObjectSet"

and I have added the following code:

onBeforeRebind: function(oEvent) {
var mBindingParams = oEvent.getParameter("bindingParams");
    mBindingParams.parameters["expand"] = "EquipmentCharacteristicsSet";
},

which triggers on "beforeRebindTable" table's event.

In the gateway it calls the getExpandedEntitySet fine and fetches all the data but in the smart table I can only see columns that are coming from the first entity which is set using the entitySet parameter. How can I display columns from the second entity as well?

former_member784571
Discoverer

I know that this is an old post, but maybe it helps some people out there.

In addition with adding the association to the expand-parameter in the onBeforeRebind event you have to add the association in the requiredAtLeastFields property of the smartTable.

That worked in my case.

Accepted Solutions (1)

Accepted Solutions (1)

jamie_cawley
Advisor
Advisor

You can add a custom column to show the value as shown at

https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.ui.comp.sample.smarttable.mtable...

Should be something like

<Table>
<columns>
<Column width="100px" hAlign="Left">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "Navpath/Column", "maxLength": "5","columnIndex":"4", "leadingProperty": "Navpath/Column"}' />
</customData>
<Text text="Column" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{Navpath/Column}" />
</cells>
</ColumnListItem>
</items>
</Table>

Regards,

Jamie

SAP - Technology RIG

raina_goyal
Participant
0 Kudos

Dear Jamie ,

I tried it but it's not working for me as it still shows the columns and data for the first entity. Please suggest if I am missing something.

Thanks,

Best Regards,

Raina

Answers (1)

Answers (1)

GeethaRanjani
Employee
Employee
0 Kudos

Did you get a solution to this?