cancel
Showing results for 
Search instead for 
Did you mean: 

Extend sap.m.TextArea

sanjoy0308
Active Participant
0 Kudos

Hi,


I am trying to extend sap.m.TextArea, but not getting editable text area.


Regards,

Sanjoy

Accepted Solutions (0)

Answers (2)

Answers (2)

sanjoy0308
Active Participant
0 Kudos

jQuery.sap.declare("test.controls.MyTextArea");

jQuery.sap.require("sap.m.TextArea");

sap.m.TextArea.extend("test.controls.MyTextArea", {

  metadata: {

  library: "test.controls",

  properties: {

  showLimit : {type: "int", defaultValue: 100}

  },

  aggregations: {},

  events: {}

  },

  renderer: {

  render: function(oRm, oControl) {

  oRm.write("<div");

  oRm.writeControlData(oControl);

  oRm.writeClasses();

  oRm.write(">");

  oRm.write(oControl.getValue());

  oRm.write("</div>");

  }

  }

});

View

jQuery.sap.require("test.controls.MyTextArea");

sap.ui.jsview("test.test", {

  /** Specifies the Controller belonging to this View.

  * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.

  * @memberOf test.test

  */

  getControllerName : function() {

  return "test.test";

  },

  /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.

  * Since the Controller is given to this method, its event handlers can be attached right away.

  * @memberOf test.test

  */

  createContent : function(oController) {

  return new sap.m.Page({

  title: "Title",

  content: [

           new test.controls.MyTextArea({value: "Sanjoy"})

  ]

  });

  }

});

kedarT
Active Contributor
0 Kudos

Hi Sanjoy,

Please post the code for extending the control.

Private_Member_15166
Active Contributor
0 Kudos

Code please.