Skip to Content

Factory function problem: sap.ui.table.Table

Hello All,


I am using factory function on 'rows' aggregation for sap.ui.table.table to display different control templates in one column. It doesn't give me values, model binding is working fine, I can see the scroll bar visible with paginator as well, but no values.


Please check the full code here and let me know where I might be going wrong: Plunker


Thank you!

Regards,

Sai Vellanki.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 14, 2016 at 05:55 AM

    Hi Sai

    I doubt your factory implementation will work because the template is in the column object.

    JS Bin - Collaborative JavaScript Debugging

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 14, 2016 at 10:20 AM

    Hi Sai,

    I had done some change in your code

    var oTable2 = new sap.ui.table.Table("oTable", {

    visibleRowCount: 5,

    navigationMode: "Paginator",

    rowSelectionChange: function(oEvent) {

    oController.onSelectionChange(oEvent);

    }

    });

    //Define the columns and the control templates to be used

    oTable2.addColumn(new sap.ui.table.Column({

    label: new sap.m.Label({

    text: "ID"

    }),

    template:new sap.m.Text().bindProperty("text", "ProductId"),

    }));

    oTable2.addColumn(new sap.ui.table.Column({

    label: new sap.ui.commons.Label({

    text: "Product"

    }),

    template:new sap.m.Text().bindProperty("text", "Name")

    }));

    oTable2.addColumn(new sap.ui.table.Column({

    label: new sap.ui.commons.Label({

    text: "Availability"

    }),

    template:new sap.m.ComboBox({

    width: "150px",

    value: "{Availability}"

    })

    }));

    with that respective change i got this as output

    To display the values in the combobox u have to use list items then u will get those values.

    I hope this will be helpful.

    Thanks,

    Deepak Raj


    scn.PNG (158.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.