我做了一個PanelMenu,我試圖給根子菜單添加一個圖標,但它不工作。在PrimeFaces 6.0的根子菜單上支持用戶圖標PanelMenu
<p:panelMenu>
<p:submenu label="Üye işlemleri" icon="fa fa-user-plus">
<p:menuitem value="Üye Kayıt" icon="fa fa-user-plus"
action="#{redirect.toRegister()}" />
<p:menuitem value="Üye Düzenle" icon="fa fa-pencil" />
</p:submenu>
<p:submenu label="Kullanıcı işlemleri" icon="ui-icon-extlink">
<p:menuitem value="Anasayfa" icon="fa fa-home"
action="#{redirect.toMainPage()}" />
<p:menuitem value="Üye Kayıt" icon="fa fa-user-plus"
action="#{redirect.toRegister()}" />
<p:menuitem value="Üye Düzenle" icon="fa fa-pencil" />
</p:submenu>
</p:panelMenu>
你有什麼想法?我也嘗試用ui-icon(不是fontawesome)。我不想更改默認子菜單圖標。我想添加到默認圖標旁邊,如this page。你可以看例子,特別是在Navigation> Link。正如你所看到的,鏈接是一個子菜單。它是否真的必須是2個子菜單才能添加圖標?
編輯------
我呈現類坐上 「PanelMenuRenderer」 延伸,我faces-config.xml中的;
<render-kit>
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.PanelMenuRenderer</renderer-type>
<renderer-class>denemeExample.my</renderer-class>
</renderer>
</render-kit>
當我嘗試運行它時出現錯誤。
An Error Occurred:
javax/servlet/jsp/jstl/core/Config
- Stack Trace
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:344)
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
我試圖解決內部WEB-INF/lib目錄,但不解決,服務器開始工作unlogical這將JSTL-1.2.jar和jsp-api.jar文件。它不像x:p:outputLabel或h:outputLabel中的任何代碼。我認爲tomcat不運行。最後我使用PrimeFaces 6.0和jsf 2.2。那麼你有什麼想法我該怎麼做?
非常感謝你對我的問題的信息和編輯。我明天會做,我會用解決方案編輯我的文章。再次感謝你 :) –