title: Remove a Control from View
body: <p>I am trying to create a sap.m.Text at runtime and remove the created element. Creation is straight forward but deleting the elements is a problem. I couldn't find a way to do it.</p>
  
  <p>Code :</p>
  
  <p>Create
  new sap.m.Text(this.createId("Row1"))</p>
  
  <p>Remove</p>
  
  <pre><code>_oThis.getView().removeContent(1); // Doesn't work
  _oThis.getView().removeContent(oObjText); // Doesn't work
  _oThis.getView().removeContent(sap.ui.getCore().byId('Row1')); // Doesn't work
  _oThis.getView().removeContent(view.byId(oo));   // Doesn't work
  _oThis.getView().removeContent('Row1');   // Doesn't work
  </code></pre>
  
  <p>The thing that removes the element os $('Row1').remove(); // But doesn't remove from aggregation and gives a duplicate ID error if added back with same ID 'Row1'</p>
  
  <p>PS : 
  $('Row1').remove() doesn't truly work as its not deleted from view object. How to remove a Text/Button or any control from JS View by ID ?</p>
  
  <p><a href="https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.core.mvc.View.html#removeContent" rel="nofollow">https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.core.mvc.View.html#removeContent</a></p>