0

How to properly wire variable?

asked 2014-03-24 09:23:32 +0800

demizon gravatar image demizon
169 1 6

Hello,

I got following problem...lets say i have viewmodel class MyVM defined like this:

@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class)
public class MyVM{

    @WireVariable
    private ModulsManager modulsManager;

@Command
getAll() {modulsList = modulsManager.getAll();
         }

@Command
addHlayout() {MyHlayout myHlayout = new MyHlayout();
             }
}

MyHlayout class:

@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class)
public class MyHlayout extends Hlayout {

    @Autowired
    @WireVariable
    private ModulsManager modulsManager;
MyHlayout() {        
        modulsManager.getAll();}

}

When I use modulsManager in viewmodel everything works well. But when I use it on MyHlayout class I am getting null pointer exception error. Anyone can help me how to fix this?

Thx.

delete flag offensive retag edit
Be the first one to answer this question!
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: 2014-03-24 09:23:32 +0800

Seen: 35 times

Last updated: Mar 24 '14

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