Putting it all Together

From Documentation
Revision as of 01:57, 14 July 2010 by Tmillsclare (talk | contribs) (Created page with 'Finally we put all the component information together to produce the result below. <source lang="java"> package com.foo; public class SimpleLabel extends org.zkoss.zk.ui.HtmlBa…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Finally we put all the component information together to produce the result below.

package com.foo;

public class SimpleLabel extends org.zkoss.zk.ui.HtmlBasedComponent {
	private String _value = ""; // a data member

	public String getValue() {
		return _value;
	}

	public void setValue(String value) {
		if (!_value.equals(value)) {
			_value = value;
			smartUpdate("value", _value);
		}
	}

	protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
			throws java.io.IOException {
		super.renderProperties(renderer);
		render(renderer, "value", _value);
	}
}

Having implemented the Component we now need to implement the Widget.