Skip to Content
avatar image
Former Member

SAPUI5 Table not showing data

Hello,

I am trying to display a table in sapui5, but the problem is that neighter sap.m.table, nor sap.ui.table is showing any data, despite the fact that in the developer tools I can see that the items and the cells (for sap.m) are there and filled, and the columns and rows are filled (for sap.ui).

The table is in a block from a ObjectPageSection. The columns are shown, but a "no Data"-Text is displayed instead of the actual data.

Does anybody have any idea, why the rows wouldn't be displayed?

Also if I add a column in the Controller with the method addColumn, the column is added to the table in the developer tools, but is not shown in the app.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • May 24, 2017 at 08:57 AM

    Hi Cristina,

    For better understanding of your issue please share the code snippet(Binding and Model Setting).So that we can help you in resolving your issue.

    Regards,

    Shekar

    Add comment
    10|10000 characters needed characters exceeded

    • Hi ,

      Not able to reply on your last comment ... so replying here ..

      Just thinking might be this could be a issue .. just give a try ..

      Actually what happens sometimes that as the binding is dynamic for both column and rows so if the binding takes time than the container (here object page layout . section , subsection) thinks that there is no content and makes the content section height 0 , can you just check in F12 (developers tool) by picking the element where the table needs to be render and try to increase the height of that element ..by providing some height in pixels

      i face such a issue once a way long back ago. Just let me know your response so accordingly i will proceed for any other solution.

      thanks

      viplove

  • avatar image
    Former Member
    May 26, 2017 at 06:23 PM

    sample Code

    var oModel = new sap.ui.model.json.JSONModel();
    oModel.loadData("json/Item.json");

    //Create an instance of the table control
    var oTable = new sap.ui.table.Table({
    title: "Table Example",
    visibleRowCount: 2,
    firstVisibleRow: 5,
    selectionMode: sap.ui.table.SelectionMode.Single
    });

    //Define the columns and the control templates to be used
    var oColumn = new sap.ui.table.Column({
    label: new sap.ui.commons.Label({text: "First Name"}),
    template: new sap.ui.commons.TextView().bindProperty("text", "key"),
    width: "100px"
    });
    oTable.addColumn(oColumn);

    oTable.setModel(oModel);//Bind with model
    oTable.bindRows("/mData");//Bind with data

    Add comment
    10|10000 characters needed characters exceeded

  • May 28, 2017 at 08:34 AM

    If the data is in the debugger and not appearing on the screen, it should be a problem with the binding of the right paths/variables ot the controls on Views.

    Regrds,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded

  • May 28, 2017 at 11:29 AM

    For using table control correctly, you should know how to do the databinding and aggregation binding.

    From your describe, I guess the aggregation binding is not correct.

    Here are some turtois for you.

    https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/bf71375454654b44af01379a3c3a6273.html

    Add comment
    10|10000 characters needed characters exceeded

  • May 29, 2017 at 03:02 AM

    Hi,

    The issue is with your data binding connection with the backend.

    1st check if you are passing the backend Service URL correctly to the IDE.

    Once, I had faced this issue and I was passing the column name is upper case, while when I checked my metadata, the column name was a mix of upper and lower case. So, please check if the issue is due to case sensitivity.

    If you are still not able to resolve it, let me know I will share my code snippets. May be that will help you.

    Thanks

    Meenakshi

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08 at 06:18 PM

    Hello All,

    I am facing similar problem but I think reason is different and not able find out any solution. I am getting one error : Uncaught TypeError: Cannot read property 'threshold' of undefined.

    When I have checked the network in debug, I can see the $Count with proper URL. I can see the total number of record if I execute the $Count separately. Bu in my app, the URL for ODATA is not called without $Count and getting the above error.

    Can anyone help me on this issue? It will be a great help.

    Thanks,

    Arindam.

    Add comment
    10|10000 characters needed characters exceeded