Reputation: 163
is there an example for using TableTree control in SAP Fiori app. I have an OData service already defined with the association. How do I use it in my view?
Below is the view snippet:
<table:TreeTable rows="{/Zbpo_Cds_Fkkvp}"
selectionMode="None"
visibleRowCount="11"
showColumnVisibilityMenu="true"
enableCellFilter="true"
enableColumnReordering="false"
class="sapUiSizeCompact"
expandFirstLevel="true"
>
<table:columns>
<table:Column>
<Text label = "Contract Partner" text ="{gpart}"></Text>
</table:Column>
<!--<table:Column>
<Text text ="{vkont}"> </Text>
</table:Column>-->
</table:columns>
</table:TreeTable>
I have following error: Neither navigation paths parameters, nor (complete/valid) tree hierarchy annotations where provided to the TreeBinding.
Do i need to annotate my CDS view?
Thank you in advance!
Upvotes: 1
Views: 2506
Reputation: 3777
Try to create a view using HIERARCHY statement in hdbview, not in CDS, etc. like this:
VIEW "myview"
AS SELECT
"HIERARCHY_RANK" ,
"HIERARCHY_PARENT_RANK" ,
HIERARCHY_LEVEL - 1 AS "HIERARCHY_LEVEL" ,
*
FROM
HIERARCHY ( SOURCE (
SELECT
ID AS node_id,
PARENT_ID AS parent_id,
*
FROM
"mytable" ) )
then reference this view in your xsoadata definition.
Upvotes: 0
Reputation: 91
would this example be useful for you? http://scn.sap.com/community/developer-center/front-end/blog/2015/10/23/treetable-odata-binding
kind regards, Gabriel
Upvotes: 1