updated
<?page title="example"?>
<window id="music" apply="com.main">
<combobox id="combo" autodrop="true" onChanging="music.suggest()"/>
</window>
java
public class main extends GenericComposer{
/**
*
*/
private static final long serialVersionUID = 1L;
Combobox combo;
public void suggest() {
combo.getFellow("combo");
combo.getItems().clear();
combo.appendItem("Ace");
combo.appendItem("Ajax");
combo.appendItem("Apple");
combo.appendItem("Best");
combo.appendItem("Blog");
}
}
它表示空指针异常y ???
答案 0 :(得分:1)
我修改了你的代码,你可以尝试一下:)
ZUL
<?page title="example"?> <window id="music" apply="com.mainComposer"> <combobox id="combo" autodrop="true"/> </window>
爪哇
public class mainComposer extends GenericForwardComposer{
Combobox combo; //ZK Auto Wired , use combo directly
public void onChanging$combo() { // ZK Autoforward (Awesome !!)
suggest();
}
public void suggest() {
combo.getItems().clear();
combo.appendItem("Ace");
combo.appendItem("Ajax");
combo.appendItem("Apple");
combo.appendItem("Best");
combo.appendItem("Blog");
}
}
答案 1 :(得分:0)
作曲家应该扩展GenericForwardComposer而不是Window。试试这个,自动装配应该可以工作。