Hi Colin,

By trying to help you on this topic, I finally end up with a working
ContextMenu implementation (so, I add it in
wicket-jquery-ui-6.8.2-SNAPSHOT...)
You can either use it or have a look at the code to complete your own if
this one does not full-fit your needs...

ContextMenu:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/ContextMenu.java

ContextMenuBehavior:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/ContextMenuBehavior.java

The usage is the following:

final ContextMenu menu = new ContextMenu("menu", newMenuItemList()) {

    private static final long serialVersionUID = 1L;

    @Override
    protected void onContextMenu(AjaxRequestTarget target, Component
component)
    {
        //the menu-item list can be modified here
        //this.getItemList().add(new MenuItem("my new item"));
    }

    @Override
    public void onClick(AjaxRequestTarget target, IMenuItem item)
    {
    }
};

this.add(menu);

final Label label = new Label("label", "my label");
label.add(new ContextMenuBehavior(menu));
this.add(label);


There is a demo here:
http://www.7thweb.net/wicket-jquery-ui/menu/ContextMenuPage


Hope you will like it,
Best regards,
Sebastien.

Reply via email to