Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Tree Table not rendering correctly

BrianSm
Discoverer
0 Kudos
259

Hello,

I'm hoping someone has run across this issue before. I have seen a ton of similar posts, but none of the solutions that I've tried has worked. I'm building this in BTP using Business Application Studio and connecting to our on-premise ECC system. 
I'm trying to build an SAPUI5 Tree Table with only 1 level to expand (possibly 2 in the future). The child nodes are not showing up under the parent nodes. Nodes 3 and 4 should be under the first node and node 5 should be under the 2nd node. 
The first two rows below should be parent nodes, I’ve added NodeID, ParentNodeID, HierlevelID and DrillState to the table just to show what values are coming through.

Appreciate your time and I'm open to any and all suggestions or other ways to do this!

 

BrianSm_0-1741719643794.png

The nodes do expand, but only a blank line is shown.

BrianSm_1-1741719693250.png

This is the CDS view that I'm using. 

BrianSm_2-1741719721474.png

This is my controller logic - only added to replace the 0 with ‘null’ for the ParentNodeID. The output is the same with ‘null’ and 0 as the value (If anyone has a better solution to get ParentNodeID set to 'null", please let me know).

BrianSm_3-1741719999626.png

 



 

My view.xml

<mvc:View controllerName="maintenanceplanner.controller.AssignedOrdersTree"
 xmlns="sap.ui.table"
    xmlns:m="sap.m"
    xmlns:mvc="sap.ui.core.mvc"
    height="100%">
 
    <TreeTable
        id="idTreeTable"
        selectionMode="Single"
        enableColumnReordering="false"
     
        rows="{
            path : 'NodeDataModel>/',
            parameters : {
                treeAnnotationProperties : {
                    hierarchyLevelFor : 'NodeDataModel>HierLevel',
                    hierarchyNodeFor : 'NodeDataModel>NodeID',
                    hierarchyParentNodeFor : 'NodeDataModel>ParentNodeID',
                    hierarchyDrillStateFor : 'NodeDataModel>DrillState'
                }
            }
        }">  

        <columns>
            <Column id="idNodeDescCol">
                <m:Label id="idPersonnelText" text = "Personnel"/>
                <template>
                    <m:Text id="idNodeDescText" text="{NodeDataModel>NodeDescription}" wrapping="false" />
                </template>
            </Column>
           
            <Column id="idOperationDescCol" >
            <m:Label id="idOrderLabel" text = "Work Order"/>
                <template>
                    <m:Text id="idOrderText" text="{NodeDataModel>OrderNo}" wrapping="false" />
                </template>
            </Column>
           
            <Column id="idOperationActCol" >
            <m:Label id="idActLabel" text = "Activity"/>
                <template>
                    <m:Text id="idActText" text="{NodeDataModel>Activity}" wrapping="false" />
                </template>
            </Column>
           
            <Column id="idNodeID" >
            <m:Label id="idNodeIDLabel" text = "NodeID"/>
                <template>
                    <m:Text id="idNodeIDText" text="{NodeDataModel>NodeID}" wrapping="false" />
                </template>
            </Column>

            <Column id="idParentNodeID" >
            <m:Label id="idParentNodeIDLabel" text = "ParentNodeID"/>
                <template>
                    <m:Text id="idParentNodeIDText" text="{NodeDataModel>ParentNodeID}" wrapping="false" />
                </template>
            </Column>

            <Column id="idHierLevelID" >
               <m:Label id="idHierLevelLabel" text = "HierLevelID"/>
                <template>
                <m:Text id="HierLevelText" text="{NodeDataModel>HierLevel}" wrapping="false" />
                </template>
            </Column>

            <Column id="idDrillState" >
               <m:Label id="idDrillStateLabel" text = "DrillState"/>
                <template>
                <m:Text id="idDrillStateText" text="{NodeDataModel>DrillState}" wrapping="false" />
                </template>
            </Column>
   
         
            <Column id="idBasicStartDate" >
               <m:Label id="idBasicStartDateLabel" text = "Basic Start Date"/>
                <template>
                <m:Text id="idBasicStartDateText" text="{NodeDataModel>BasicStartDate}" wrapping="false" />
                </template>
            </Column>
           
        </columns>

    </TreeTable>

</mvc:View>

 

2 REPLIES 2

Raifloresca
Explorer
0 Kudos
189

0 Kudos
138

Thank you for the suggestion, Raifloresca. After looking at that example, I was not able to make the tree table function correctly doing it that way either. 

Thanks,

Brian