Tuesday, June 25, 2013

ZK Listbox Data Filter Demo

ZK Provide Data Filter in Listbox,Grid I have created a Very Basic Demo application to apply Filters in Listbox.
ZUL file Code
And View Model Or Java Class

Its a Very basic developer can modify the code as their requirement.

12 comments:

  1. So, where is the code?

    ReplyDelete
    Replies
    1. Sorry, it didn't appear until i logged in with my google account....

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Check method getFilterPersons() its return myPersonList and getFilterPersons() called inside changeFilter().Rest this code will do magic
    List myPersonList1 = getFilterPersons(people);
    modelList = new ListModelList(myPersonList1);

    ReplyDelete
    Replies
    1. Problem is, this create all time a new (not configured with multi checkboxes) ListModelList(myPersonList1). Even the checked state is reset after you use again the data filter.

      Delete
    2. Ok, just did create one time the ListModel inside the Data Filter what bind this model to the view controller. So instead that they new create a ListModel it just change the innerLists what work well in my case.

      Delete
    3. Do you mean you able to resolve the issue.

      Delete
    4. Not resolved fully. How can you set/change your myPersonList from outside, because this represent normaly the search result of a function.

      Delete
    5. Do one think mail me or chat subodhcjoshi82@gmail.com let me try to understand your problem clearly

      Delete
    6. Currently, I did add a autowire to the Data Filter Model to get access to the full List of entries.

      @Wire("#btSearch")
      private Button btSearch;
      @Wire("#btClear")
      private Button btClear;


      @AfterCompose
      public void afterCompose(@ContextParam(ContextType.VIEW) Component view){
      Selectors.wireComponents(view, this, false);
      myRowList = new ArrayList();
      btSearch.addEventListener("onClick", new EventListener() {
      public void onEvent(Event event) {
      refreshModelList();
      }
      });
      btClear.addEventListener("onClick", new EventListener() {
      public void onEvent(Event event) {
      refreshModelList();
      }
      });
      }

      Delete