I am trying to show a menu when I click an image (onclick event). But the problem is when I set the attribute "position" to "dynamic", my page fails to render and gives the following null pointer exception:
java.lang.NullPointerException
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:561)
at org.primefaces.component.menu.MenuRenderer.encodeScript(MenuRenderer.java:59)
at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:38)
My menu code is:
Code: Select all
<p:menu position="dynamic" widgetVar="myMenu">
<p:menuitem><h:commandLink value="Download document" url="#"/></p:menuitem>
<p:menuitem><h:commandLink value="Upload document" url="#"/></p:menuitem>
<p:menuitem><h:commandLink value="Update document" url="#"/></p:menuitem>
</p:menu>
Any help will be highly appreciated. Thanks in advance