Wicketstuff Ajax Problem with ContextMenu

View: New views
1 Messages — Rating Filter:   Alert me  

Wicketstuff Ajax Problem with ContextMenu

by elenstoll () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, all people of this forum!
I have a question to the ContextMenu with Yui Wicketstuff. Because:
If the component which contains the ContextMenu is added to the AjaxRequestTarget, this Menu does not function any more. The menu is to see (with the right mouse click), but when click nothing happens...I will be very grateful if somebody can help me! Here is the code:
public abstract class View extends Panel implements ViewIF{
public void handleMenu() {
  List<BMenuItem> menues = getMenueItems();
  if (null == menues || menues.size() == 0) return;
  lMenu = new YuiContextMenu("menu");
  for (final BMenuItem menuItem : menues) {
      MenuItem lMenuItem=new MenuItemExtension(menuItem.getKey(),menuItem.getName(),menuItem);
      lMenu.add(lMenuItem);
  }
  setOutputMarkupId(true);
  behavior = new YuiContextMenuBehavior(lMenu);
  behavior.applyAttributes( this, lMenu, new Model("targetID") );
  add(behavior);
}
}protected final void addMenuContent(final View pMenuComponent) {
  add(pMenuComponent);
  pMenuComponent.add(new AjaxEventBehavior("onclick") {
     protected void onEvent(AjaxRequestTarget target) {
     ...target.addComponent(pMenuComponent);...}
  });
}
Thank you in advance.
Elena