I wish this helpful for you I would highly recommend you learn ZK using MVVM binding over MVC. It has a lot more advantages. The MVVM demo might also be helpful. Your example above using MVVM would look something like:
this will help You should encapsulate the functionality of the GUI. The client shouldn't have any knowledge of its inner workings whatsoever. Instead, you should provide a semantically meaningful public method that describes the task it will perform - in this case updating the display. Ideally you should have an interface that represents your GUI actions also - this will decouple the client from the GUI and will mean you can have multiple UIs implement the interface and the client doesn't care which UI it is using.
Is there a wrapper that provides access to the components of HttpServletResponse in Java?
To fix this issue Take a look at this video, helped me a lot regarding this. Anyway a small example, assuming you have a Button named "Button1" in your UI. You can access it in your StateMachine under findButton1()