Skip to Content
avatar image
Former Member

sap.m.table utility function issue


Can someone please help on the below issue where I am not able to bind the data to the table?

For the table utility function:

function createMTable(tableID, colList, queryPath){
	var RefreshDate = new Date();

	var oTable;	
	var oModel = new sap.ui.model.xml.XMLModel();
	if(sap.ui.getCore().byId(tableID) == null) {
		oTable = new sap.m.Table({
			id: tableID,
			width : "100%",
			columns: colList,

			items: {
				path: queryPath ,
				template: new sap.m.ColumnListItem()

	} else {
		oTable =  sap.ui.getCore().byId(tableID) ;

       		 columns: colList,
       		 rows: "/Rowset/Row"

	return oTable;

For the columns utility function : 

function createMColumn(colID, labelText, valueElement) {

	var oColumn = new sap.m.Column({
	header: new sap.m.Label({text: labelText})
/****here we don't have template option to bind the value element from query
like this:  
template: new sap.ui.commons.TextView().bindProperty("text", valueElement),
how to define the template here?
	return oColumn;

Thanks for your help,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 20, 2018 at 03:21 PM


    I am unclear as of to your issue. You don't define a template in the sap.m.Column class.

    You define the columns. In them, you define the ColumnListItem and in them a cell of type sap. ui.core .Control . In them, you can define a formatter, which is what you call a template. Please take a look at the samples and the documentation. If I have misunderstood you please narrow down the question to the most specific issue, so I can try and help you with.

    Add comment
    10|10000 characters needed characters exceeded