Jsf rich:modalPanel仅出现几秒钟
我使用了rich:menuItem来显示rich:modalpanel。rich:menuItem的代码如下:Jsf rich:modalPanel仅出现几秒钟,jsf,richfaces,Jsf,Richfaces,我使用了rich:menuItem来显示rich:modalpanel。rich:menuItem的代码如下: <rich:menuItem> <a4j:commandLink value="Add Machine" oncomplete="#{rich:component('addMachinePanel')}.show()" reRender="addMachinePanel"> </a4j:comm
<rich:menuItem>
<a4j:commandLink
value="Add Machine"
oncomplete="#{rich:component('addMachinePanel')}.show()"
reRender="addMachinePanel">
</a4j:commandLink>
</rich:menuItem>
rich:modalpanel代码是
<rich:modalPanel id="addMachinePanel">
<a4j:form>
<a4j:commandButton value="Cancel"
action="#{adminBean.cleanupMachineToEdit}"
onclick="#{rich:component('addMachinePanel')}.hide(); return false;" />
</a4j:form>
</rich:modalPanel>
在上面的代码中,rich:modalpanel出现了一两秒钟,然后又消失了。
请帮我找出问题所在
谢谢默认情况下,
rich:menuItem
的submitMode
属性是server
,它将提交表单并完全刷新页面
您可以将submitMode
更改为ajax
,以执行ajax表单提交。只有使用reRender
属性指定的元素将被刷新,而不是整个页面
或者,您可以将其更改为none
(对于richfaces 3.X)或client
(对于richface 4.0),以便不提交表单
<rich:menuItem submitMode="ajax">
<a4j:commandLink
value="Add Machine"
oncomplete="#{rich:component('addMachinePanel')}.show()"
reRender="addMachinePanel">
</a4j:commandLink>
</rich:menuItem>