0

I use Primefaces 4.0.15 and I build a dynamic megamenu. It works on regular browsers. But on touch devices, a menuitem without subitems does not get triggerd. I tried adding a single megamenu in the xhtml page itself and then it works. I compared both generated HTML and they seem to me the same. Any ideas on what the problem could be?

This is the resulting HTML that is not working

<div id="menu:mainMenu" class="ui-menu ui-menubar ui-megamenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix" role="menubar">
<ul class="ui-menu-list ui-helper-reset">
    <li class="ui-menuitem ui-widget ui-corner-all" role="menuitem">
        <a tabindex="-1" class="ui-menuitem-link ui-corner-all" href="quote/list.xhtml">
            <span class="ui-menuitem-text">My quotes</span>
        </a>
    </li>
</ul>

dynamic menu is constructed like this:

<p:megaMenu model="#{menu.model}" autoDisplay="#{!userAgentResolver.mobileDeviceDetected}" id="mainMenu" />

java:

item = new DefaultMenuItem();
item.setValue(getMsg(menuItemTranslationKey));
item.setUrl(menuUrl);
model.addElement(item);
roel
  • 2,005
  • 3
  • 26
  • 41

1 Answers1

0

I found the problem. The autodisplay was set to false. I set it to true and it works on touch devices as well.

roel
  • 2,005
  • 3
  • 26
  • 41