gwc.componentSet.extend (Extending the component)

Existing components can be extended using the gwc.Component.extend function.

These extensions can be located in a new JavaScriptâ„¢ file that is included right after components.js (in main.xthml). The gwc.Component.extend is called with the base component constructor function as first argument and a function that extend the component as second argument.

Example

In this example, in addition to the original TextEdit behavior, a pop-up alert is raised when the field value has changed.
gwc.Component.extend(gwc.componentSet.TextEdit, function(type, did, useSandbox) {
  var gValueOrig =
  this.snippetData.gValue;
  this.snippetData.gValue = function(val){
    gValueOrig.apply(this, arguments);
    alert('the new value is:'+val);
  }
});
Note: While this documentation will highlight some of the APIs of the Client-Side Framework (CSF), it does not attempt to explain all of the APIs. The complete API reference is contained in the JavaScript code and can be extracted using the JsDoc Toolkit.