| Client-Side Framework and Components / Client-Side Framework internals | |
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.
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);
  }
});