some bugs in menu in 2.0.1

UI Components for JSF
Post Reply
ttruong
Posts: 109
Joined: 01 Mar 2010, 12:50

07 May 2010, 14:08

Found some bugs:

1. When defining a sub menu or item without a label and only with an icon the component is not (properly) displayed.

2. When using a label and an icon in a menu item there is a gap between the label and icon.
This gap does not exist when using the menu item as a facet of a sub menu.

Example:

Code: Select all

<p:menubar effect="NONE">
       <p:submenu>
        <f:facet name="label">
            <!-- ERROR: no gap between label and icon-->
            <p:menuitem value="#{msgs.ADD}" icon="/resources/image/16x16/view_menu.gif"/>
        </f:facet>
        <!-- ERROR: item is not displayed -->
        <p:menuitem icon="/resources/image/16x16/save.gif"/>
    </p:submenu>
</p:menubar>
3. Problems with comments using "<!-- -->"
In my above code I get this exception:
java.lang.ClassCastException: javax.faces.component.UIPanel cannot be cast to org.primefaces.component.menuitem.MenuItem
at org.primefaces.component.menubar.MenubarRenderer.encodeSubmenu(MenubarRenderer.java:128)
at org.primefaces.component.menubar.MenubarRenderer.encodeMarkup(MenubarRenderer.java:93)
at org.primefaces.component.menubar.MenubarRenderer.encodeEnd(MenubarRenderer.java:36)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)

When removing the comments everything is fine.

HTH Tai

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

09 May 2010, 10:50

Hi Tai,

1) As icon is placed with css, you need a label, for a blank label you can use &nbsp;

2) A screenshot would help.

3) You would need to skip comments with;

Code: Select all

<context-param>
    <param-name>facelets.SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
</context-param>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 53 guests