Search code examples
javamvvmzkzul

send notification to parent class from nested class in Zk when using mvvm


class A{
  private List<B> list;
  // getter setter
  public class B{
    @command
    public void delete(){
       // remove itself from list
       // Now how to post event to event queue to update list on browser
    }  
  }
}

The list is bind in a zul page. One way i found is to use BindUtils.postNotifyChange(null, null, this, "list"); but it doesnt work


Solution

  • If A is the VM than the correct call is

    BindUtils.postNotifyChange(null, null, A.this, "list");
    

    In java you call the this pointer in a nested class with ParentClassName.this