Question

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");

 }

 }

it says null pointer exception y???

Was it helpful?

Solution

I modified your code, you can give it a try :)

ZUL

<?page title="example"?>
<window  id="music" apply="com.mainComposer">
<combobox id="combo" autodrop="true"/>
</window>

Java

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");
  }

}

OTHER TIPS

Composers should extend the GenericForwardComposer and not Window. Try that and the autowiring should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top