Menu

#36 Component declartion Error

open
nobody
General (2)
5
2010-11-19
2010-11-19
Phoenix Wu
No

I create a component that extends Div, and it contains a combobox. when I writting zul code which is like following scope, The combobox does not display correctly, but it still is a combobox if you trace the first child on the customize component.

<?page title="Error of component tag" contentType="text/html;charset=UTF-8"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<?component name="dropdownbox" extends="div" class="DropDownBox"?>
<?component name="input-text" extends="textbox" hflex="true"?>
<zk>
<zscript><![CDATA[
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Div;

public class DropDownBox extends Div {
private Combobox innerDropDown;

public DropDownBox () {
innerDropDown = new Combobox();
innerDropDown.setRows(1);
innerDropDown.setReadonly(true);
innerDropDown.setParent(this);
}
}
]]></zscript>
<window title="Error of component tag" border="normal">
<dropdownbox id="myDropDownbox" />
<button label="Click" onClick="alert(myDropDownbox.firstChild)" />
</window>
</zk>

Discussion


Log in to post a comment.