Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<menulist id="list" pen:binding="name">
    <menupopup>
        <menuitem label="Value 1" />
        <menuitem label="Value 2" />
    </menupopup>
</menulist>

Example binding, usually defined in a controller's init. This populates the menulist with the contents of the method getListItems() in the controller:

Code Block

XulMenuList<String> list = (XulMenuList<String>) document.getElementById("list");
Binding b = bf.createBinding(this, "listItems", list, "elements");
b.fireSourceChanged();