Wicket ContextMenu elements are not clickable. No action happens on left click

Issue

This Content is from Stack Overflow. Question asked by nbond

Menu items display correctly and so does all the hover effects. However no action happens on left click. I am having trouble localising the issue, since I am not familiar with wicket. Any suggestion are greatly appreciated.

Menu element:

ContextMenu l_vendorSelectMenu = new ContextMenu( "vendorSelectMenu" ) {

      private static final long serialVersionUID = 1L;

      @Override
      protected void addMenuItem( ListItem<IMenuItem> p_item, IMenuItem p_menuItem ) {

        ProductGroupMenuItem l_menuItem = (ProductGroupMenuItem)p_menuItem;

        ProductGroupLabel l_panel = new ProductGroupLabel( "item",
                LambdaModel.of( l_menuItem.m_productGroupModel, UserProductGroup::getProductGroup ) );
        p_item.add( l_panel );

        p_item.add( new EmptyPanel( "menu" ) );
      }

      @Override
      protected String getPositionOption( Component p_component ) {
        return String.format("{ my: 'right top', at: 'left bottom', collision: 'none', of: jQuery('%s') }", JQueryWidget.getSelector( p_component ) );
      }
    };
    l_vendorSelectMenu.add( AttributeModifier.append( "style", "z-index:100;" ) );
    l_vendorSelectMenu.setOutputMarkupId(true);

    add( l_vendorSelectMenu ); 

Markup and styles:

<li class="menu-children vendor-wrapper">
        <a href="#" wicket:id="currentVendorPanel"></a>
        <wicket:container wicket:id="vendorSelectMenu"></wicket:container> </li>

 



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?