p:tabMenu不带形式 [英] p:tabMenu without form
问题描述
我有这个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>
我注意到在Primefaces网站示例上,没有一个h:form
必须在其中放置代码.但是,当我测试代码时,会收到以下消息:
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.
似乎没有h:form
我无法运行代码.我想不带表格地运行它.我该如何解决这个问题?
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?
推荐答案
如前所述,您可以通过将JSF上下文参数更改为PRODUCTION
来摆脱消息.请注意:您不要将任何内容提交给服务器,而无需将其包装成表格.如果您未将其封装在表格中,则任何会或可能最终向服务器生成请求的组件都将向您提供此日志消息.忽略自己的危险.
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.
这篇关于p:tabMenu不带形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!