Thursday, September 26, 2013

ZK:- Get Instance of any ZUL component in ViewModel

I am using ZK MVVM Architecture . Today i got problem on Button click i want Listbox instance in ViewModel or my Java class so i found a solution which is provided by ZK itself.
Let us suppose you called below method on button click


If you will get here i used query("Pass Component Name ") method and it will return the object of that component. But here can be problem if more than one type of compoennt defined in page will see how to resolve that also.

1 comment:

  1. Hi thank you

    Learned new stuff today. I will always use

    @AfterCompose
    public void initSetup(@ContextParam(ContextType.VIEW) Component view)
    {
    Selectors.wireComponents(view, this, false);

    }

    And then, i can declare the components as like declaring the variables as follows

    @Wire("#practicelist")
    private Window win;

    ReplyDelete