0

ussing mvvm

asked 2016-04-06 08:56:36 +0800

acamilo gravatar image acamilo
3 1

updated 2016-04-06 10:03:55 +0800

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

}

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-04-06 09:30:30 +0800

Darksu gravatar image Darksu
1991 1 4

Hello acamilo,

Looks like something is missing from your Class (maybe a typo).

Can you please post your code so that we can check it out?

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2016-04-07 08:40:41 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

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.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-04-06 08:56:36 +0800

Seen: 19 times

Last updated: Apr 07 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More