cancel
Showing results for 
Search instead for 
Did you mean: 

sap.ui.table doesn't show data

raffi1
Participant
0 Kudos

Hi altogether,

I am still writing a custom application, showing a table based reporting. For the first attempts I worked with sap.m.table from the SAP Web IDE standard controls.

My app was working correctly and my data was shown as expected.

Now I changed to sap.ui.table because of sorting functionality. In the example of SAPUI5 SDK (CLICK), it seems very easy and simple to use.

Now I have the problem, that nothing is shown. My coding can be seein in the attached txt-file. Besides the non showing content (header of opened app is shown correctly) variable this is undefined inside the oModel.read-function. So I made a that variable. Working with sap.m.table I didn't have this problem.

I also attached my XML-view. Don't mind about the commented lines. These are the working ones, using sap.m.table.

Data is correctly written to variable oJsonModel. What is wrong with my coding in the controller?

Thanks in advance and best regards

Christian

Accepted Solutions (0)

Answers (1)

Answers (1)

francesco_alborghetti
Active Participant
0 Kudos

Hi,

in your controller, you are creating a new sap.ui.table.Table:

var oTable = new sap.ui.table.Table();

shouldn't it be:

var oTable = oView.byId("zbkTable");

Because otherwise your table remains with list binding to /TimeEntrySet, but you are loading the data in root path of the JSON model.


raffi1
Participant
0 Kudos

Hi,

thanks for your answer. Now oTable is initialized correctly and the oData array can be found in oTable, after calling the setModel-method.

My screen is still empty. What is missing for showing the results? I added my component-coding, if there is something missing. The console in browser doesn't throw an error.

best regards

Christian

francesco_alborghetti
Active Participant
0 Kudos

Hi,

try to change your view tag with height="100%" and your page tag with enableScrolling="false", like in the sample:

<mvc:View
 controllerName="sap.ui.table.sample.Basic.Controller"
 xmlns="sap.ui.table"
 xmlns:mvc="sap.ui.core.mvc"
 xmlns:u="sap.ui.unified"
 xmlns:c="sap.ui.core"
 xmlns:m="sap.m"
    height="100%">
 <m:Page
  showHeader="false"
  enableScrolling="false"
  class="sapUiContentPadding">