Skip to content
Wicket Oat Demo
Theme: 💼 Business

Oat Dropdown Demo

A dropdown menu using the ot-dropdown web component (JS vendored in oat.min.js) and the native popover API.

How to use

// Java - each item's label, and what happens when it's chosen
add(OatDropdown.of("dropdown", "Options", Model.ofList(items), item -> item,
        (target, item) -> info("You chose " + item + ".")));

// Or populate the items yourself (each item is a <button role="menuitem"> with a "label" child),
// and call dropdown.close(target) after handling a click
add(new OatDropdown<String>("dropdown", "Options", Model.ofList(items)) {
    @Override
    protected void populateItem(ListItem<String> item) { ... }
});
<!-- HTML -->
<div wicket:id="dropdown"></div>