Skip to Content
0

sap.ui.table doesn't show data

Mar 08 at 03:01 PM

62

avatar image

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

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

1 Answer

Francesco Alborghetti Mar 08 at 04:06 PM
0

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.


Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

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">
0