Menu Toggleable Primefaces

Asked

Viewed 429 times

1

I have the following code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">

    <h:head>
        <f:facet name="first">
            <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
            <title>PrimeFaces</title>
        </f:facet>
    </h:head>

    <h:body class="body">
        <h:outputStylesheet library="css" name="style.css" />
        <p:layout fullPage="true">


            <p:layoutUnit position="north" size="50" resizable="true" closable="true" collapsible="true">
                Header
            </p:layoutUnit>


            <p:layoutUnit position="south" size="50" closable="true" collapsible="true">
                Footer
            </p:layoutUnit>

            <p:layoutUnit position="west" size="150" collapsible="false" style="width: 150px">
                <p:menu  toggleable="true" style="width: 128px; bottom: 2px">
                    <p:submenu label="Cadastros" >
                        <p:menuitem value="Demo" url="http://www.primefaces.org/showcase-labs/ui/home.jsf" />
                        <p:menuitem value="Documentation" url="http://www.primefaces.org/documentation.html" />
                        <p:menuitem value="Forum" url="http://forum.primefaces.org/" />
                        <p:menuitem value="Themes" url="http://www.primefaces.org/themes.html" />
                    </p:submenu>
                </p:menu >
                <p:menu toggleable="true">
                    <p:submenu label="Cadastros"  >
                        <p:menuitem value="Demo" url="http://www.primefaces.org/showcase-labs/ui/home.jsf" />
                        <p:menuitem value="Documentation" url="http://www.primefaces.org/documentation.html" />
                        <p:menuitem value="Forum" url="http://forum.primefaces.org/" />
                        <p:menuitem value="Themes" url="http://www.primefaces.org/themes.html" />
                    </p:submenu>
                </p:menu>

            </p:layoutUnit>

            <p:layoutUnit position="center">
                Welcome to PrimeFaces
            </p:layoutUnit>

        </p:layout>

    </h:body>

</f:view>

But when I add the tag <p:menu toggleable="true"> He says there is no toggleable menu.

This is the example of the Primeface.

<p:menu toggleable="true">
    <p:submenu label="Ajax">
        <p:menuitem value="Save" actionListener="#{menuView.save}" update="messages" icon="ui-icon-disk" />
        <p:menuitem value="Update" actionListener="#{menuView.update}" update="messages" icon="ui-icon-arrowrefresh-1-w"/>
    </p:submenu>
    <p:submenu label="Non-Ajax">
        <p:menuitem value="Delete" actionListener="#{menuView.delete}" update="messages" ajax="false" icon="ui-icon-close"/>
    </p:submenu>
    <p:submenu label="Navigations">
        <p:menuitem value="External" url="http://www.primefaces.org" icon="ui-icon-home"/>
        <p:menuitem value="Internal" outcome="/mobile/index" icon="ui-icon-star"/>
    </p:submenu>
</p:menu>

I’m using version 6.1 of Primefaces.

Why in my code does not recognize this tag?

  • You don’t need to be inside a <h:form>?

  • Not that menu. More I tested with <h:form> and gave anyway.

  • Post the error message please

  • I found the solution to the problem. I think it was some Netbeans bug. I deleted the file. jar reimported to the project after clicked on Clean and Build. After these steps he found the Tag toggleable

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.