The Redraw Method"

From Documentation
m (Created page with 'When a widget is attached to the DOM tree, zk.Widget#redraw is called to generate the HTML content. For example, assume you want to use HTML SPAN tag to house the content, we can…')
 
m
Line 1: Line 1:
When a widget is attached to the DOM tree, zk.Widget#redraw is called to generate the HTML content. For example, assume you want to use HTML SPAN tag to house the content, we can do as follows.
+
When a widget is attached to the DOM tree, zk.Widget#redraw is called to generate the HTML content. For example, assume you want to use <mp>HTML SPAN</mp> tag to house the content, we can do as follows.
  
 +
<source lang="javascript">
 
redraw: function (out) {
 
redraw: function (out) {
 
  out.push('<span', this.domAttrs_(), '>', this.getValue(), '</span>');
 
  out.push('<span', this.domAttrs_(), '>', this.getValue(), '</span>');
 
}
 
}
 +
</source>
  
 
The default implementation of <javadoc directory="jsdoc" method="redraw">zk.Widget</javadoc> delegates to a mold method depending on the mold. In this instance we override the function to provide one implementation of redraw which doesn’t use molds.
 
The default implementation of <javadoc directory="jsdoc" method="redraw">zk.Widget</javadoc> delegates to a mold method depending on the mold. In this instance we override the function to provide one implementation of redraw which doesn’t use molds.

Revision as of 04:29, 14 July 2010

When a widget is attached to the DOM tree, zk.Widget#redraw is called to generate the HTML content. For example, assume you want to use HTML SPAN tag to house the content, we can do as follows.

redraw: function (out) {
 out.push('<span', this.domAttrs_(), '>', this.getValue(), '</span>');
}

The default implementation of Widget.redraw delegates to a mold method depending on the mold. In this instance we override the function to provide one implementation of redraw which doesn’t use molds.