final YuiMenu subMenu2 = secondMenu.newSubMenu("mb_secondMenu");
subMenu2.setOutputMarkupId(true);
subMenu2.addMenuItem(new TestAction("M2 : L1"));
final YuiMenuItem m2L2 = new YuiMenuItem(new TestAction("M2 : L2"));
subMenu2.addMenuItem(m2L2);
subMenu2.addMenuItem(new AjaxLinkAction("M2 : L3 (Ajax) - toggles M2 : L2")
{
@Override
public void onClick(AjaxRequestTarget target)
{
MenuBar2Page.this.info(getName().getObject());
m2L2.setDisabled(!m2L2.isDisabled());
m2L2.setChecked(!m2L2.isDisabled());
m2L2.setSelected(m2L2.isChecked());
target.addComponent(feedback);
target.addComponent(mb);
}
});
subMenu2.addMenuItem(new TestAction("M2 : L4"));