Skip to Content
0

UI5 TreeTable - Binding error in XML view

Jan 26, 2017 at 03:54 PM

69

avatar image

Hi everyone,

currently I`m facing problems creating a treetable in an extension project.

The Odata service is already modified and is working fine with annotations. Now, when enhancing the view xml there is an error while executing GET on the odata service.

Error: "Invalid parameter type used at function 'eq' "

It seems like the error occurs because the HierarchyLevel is sent as a string, but in the backend it is defined as an integer, which is necessary.

We`ve tested in the index.html where we created the table in js. That way there is no error. No string / integer error.

index.html (Working)

var oTable = new sap.ui.table.TreeTable({           
columns : [ new sap.ui.table.Column({                  
 label : "ObjectId",                
 template : "ObjectID"
 }),
 new sap.ui.table.Column({                   
 label : "NumberInt",                     
 template : "NUMBER_INT"
})],      
selectionMode : sap.ui.table.SelectionMode.Single,
enableColumnReordering : true
});
var sServiceUrl = "/sap/opu/odata/Z/Mod_SRV/";
var oModel = new sap.ui.model.odata.v2.ODataModel(sServiceUrl, {
useBatch : true });
oTable.setModel(oModel);
oTable.bindRows({
 path : "/DemandCollection",
 length: 20,       
 parameters : {
  countMode : "Inline",               
  numberOfExpandedLevels : 0,                  
  top: 20
 }
});

S1Custom view (not working)

<t:TreeTable id="demandsTable" selectionMode="Single"
enableColumnReordering="true"                                                    
rows="{ path : '/UnsourcedDemandCollection', lenght : 20, parameters : {
countMode: 'Inline', numberOfExpandLevels : 0, top : 20} }">
                                                
<t:columns>
.....                                         
</t:columns>
</t:TreeTable>

Parameters of Get request:

We've also tried to create only the table in the view xml and bind rows in the controller but the same error occurs.

Did any

of you face the same problem? Any solution suggestions?

Thanks in advance!

Oe

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers