Jsf rich:modalPanel仅出现几秒钟

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来显示rich:modalpanel。rich:menuItem的代码如下:

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