Skip to Content
avatar image
Former Member

How to bind data into smart table tree table

  1. Currenty i'm using a Odata service to bind data to a tree table. I need to create a smart table (with type of tree table) using same Odata Service. Need to support smart filter as well. Can some one explain? thank you very much

this is my xml view

smartFilterBar:SmartFilterBar id="smartFilterBar" 
entityType="WipTemplatesType">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="ProductType" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false">
</smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>

<smartTable:SmartTable tableType="TreeTable" id="smartTable_ResponsiveTable" smartFilterId="smartFilterBar" editable="false"
entitySet="WipTemplates"
tableBindingPath="/WipTemplates"
useVariantManagement="false" useTablePersonalisation="true" header="Products" showRowCount="true"
useExportToExcel="false" enableAutoBinding="true">
</smartTable:SmartTable>

this is the annotation for Columns

<Annotations Target="PMTS_SERVICES.WIPTemplateOdataSvc.WipTemplatesType" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotation Term="com.sap.vocabularies.UI.v1.LineItem">
<Collection>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
        <PropertyValue Property="Value" Path="WipTemplateId"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
       <PropertyValue Property="Label" String="Order Item ID"/>
       <PropertyValue Property="Value" Path="OrderItemId"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
         <PropertyValue Property="Value" Path="PONumber"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
        <PropertyValue Property="Value" Path="CalculationMethod"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
         <PropertyValue Property="Value" Path="DepartmentId"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
        <PropertyValue Property="Value" Path="Tasks"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
       <PropertyValue Property="Value" Path="ProductType"/></Record>
        <Record Type="com.sap.vocabularies.UI.v1.DataField">
       <PropertyValue Property="Value" Path="Tasks"/>
     </Record>
</Collection>
</Annotation>
</Annotations>

this is the controller

var sPath = jQuery.sap.getModulePath("attune.wipWIP.localService");
var oModel = new sap.ui.model.odata.v2.ODataModel("destinations/pmts/PMTS_SERVICES/WIPTemplateOdataSvc.xsodata/", {
annotationURI: sPath + "/metadata_wip_annotation.xml",
useBatch: true
});
oModel.setDefaultBindingMode("TwoWay");
this.getView().setModel(oModel);

I'm Getting following error

"Neither navigation paths parameters, nor (complete/valid) tree hierarchy annotations where provided to the TreeBinding"

here is the output

smarttree-table.png

normal tree table (without smart table) out put as follows

treetable.png

Need to add "Task", "Planned Date", "Actual Date" Columns to smart tree table as well.

(these are the properties of children)

thank you very much

treetable.png (24.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers