问题
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