title: Dynamic content type of table cell
body: <p>I get data from a database, make a model out of it and bind to a table.</p>
  
  <p>I have a problem with one databse field that contains dataURL of the image or "Not Available" if no image is present.</p>
  
  <p>The problem is that depending on the database field value, the cell of the table should be sap.m.Image or sap.m.Text.</p>
  
  <p>And I can't get it to work.</p>
  
  <p>Here is the relevant code part:</p>
  
  <pre><code>var signatureData = {};
  signatureData.item = "Signature";
  signatureData.value = data.signature;
  
  var oModelSignature = new sap.ui.model.json.JSONModel();
  oModelSignature.setData(signatureData);
  var oSignatureTable  = sap.ui.getCore().byId("reportDetailsSignature"); 
                  oSignatureTable.setModel(oModelSignature);
  
  var oSignature;
  if(data.signature == "Not Available"){
      oSignature = new sap.m.Text({text: "{value}"});
  }else{
      oSignature = new sap.m.Image({src: "{value}", width: "7%", height: "7%"});
  }
  
  oSignatureTable.bindItems("/", new sap.m.ColumnListItem({
      cells : [ new sap.m.Text({text: "{item}"}),
               oSignature,]
  }));
  </code></pre>
  
  <p>I have my table empty with "No data".</p>