p:tabMenu without form

孤者浪人 提交于 2019-12-13 04:13:07

问题


I have this p:tabMenu:

<p:tabMenu id="tabs" activeIndex="0" >  
    <p:menuitem value="General" url="/DCProfileTabGeneral.jsf"/>  
    <p:menuitem value="Zones" url="/DCProfileTabZones.jsf"/>  
    <p:menuitem value="UPS" url="/DCProfileTabUPS.jsf"/>  
    <p:menuitem value="Storages" url="/DCProfileTabStorages.xhtml"/>  
    <p:menuitem value="Servers" url="/DCProfileTabServers.xhtml"/>  
    <p:menuitem value="Racks" url="/DCProfileTabRacks.xhtml"/>
    <p:menuitem value="Networks" url="/DCProfileTabNetworks.xhtml"/>  
    <p:menuitem value="ISPs" url="/DCProfileTabISPs.xhtml"/>                            
    <p:menuitem value="Generators" url="/DCProfileTabGenerators.xhtml" />  
    <p:menuitem value="HVACs" url="/DCProfileTabHVACs.xhtml"/>  
    <p:menuitem value="History" url="/DCProfileTabHistory.xhtml"/>

</p:tabMenu>  

I noticed that on the Primefaces website example there is not a h:form in which the code must be placed. But when I test the code the get this message:

The form component needs to have a UIForm in it's ancestry. 

It seems that I cannot run the code without a h:form. I want to run it without form. How I can solve this problem?


回答1:


As anon stated, you can get rid of the message by changing your JSF context param to PRODUCTION. A word of caution: You don't get to submit anything to the server without wrapping it in a form. Any component that will or might end up generating a request to the server will give you this log message if you don't enclose it in a form. Ignore at your own peril.



来源:https://stackoverflow.com/questions/12749850/ptabmenu-without-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!