-
FEATURED COMPONENTS
First time here? Check out the FAQ!
when I try to run my zul page i got that error org.zkoss.zk.ui.UiException: Property 'palavraChave' not found on type classes.CarServiceViewModel at [file:/C:/Users/acamilo/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mvmv/index.zul, line:6] org.zkoss.bind.impl.MiscUtil.mergeExceptionInfo(MiscUtil.java:175)
Here goes my java class
package classes;
import java.util.ArrayList; import java.util.List;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange;
public class CarServiceViewModel {
private String palavraChave;
private List<Car> carList;
private Car selectedCar;
private CarService carService = new CarServiceImpl();
@Command
@NotifyChange("carList")
public void search(){
carList = carService.search(palavraChave);
}
@Init
public void init(){
palavraChave = "";
carList = new ArrayList<Car>();
selectedCar = new Car();
}
}
Hello Acamilo,
You did forget to generate a getter (and maybe setter if you use @bind) for your
private String palavraChave;
ZK uses the getters/setters to acces the properties of a viewmodel (or pojo). That's also the reason why :
@load(vm.palavraChave)
is the same as :
@load(vm.getPalavraChave())
Greetz chill.
Asked: 2016-04-06 08:56:36 +0800
Seen: 19 times
Last updated: Apr 07 '16