Frage

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

War es hilfreich?

Lösung

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

Andere Tipps

I'm not quite clear on what the question is, but I'll take a stab at answering it.

Since B is not static (must exist within the context of an instance of A), you can call A.this.list to access list from within B.

Try it:

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

Reference:

http://fossies.org/dox/zk-src-6.5.3/classorg_1_1zkoss_1_1bind_1_1BindUtils.html#a0634db05f8a346fc6cdd6a2c57848879

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top