【问题标题】:rich:modalPanel appearing for some seconds onlyrich:modalPanel 仅出现几秒钟
【发布时间】:2011-07-11 16:30:01
【问题描述】:

我使用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 会出现一两秒然后又消失。 请帮我找出问题。

谢谢

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    默认情况下,rich:menuItemsubmitMode 属性为 server ,它将提交表单并完全刷新页面。

    您可以将submitMode 更改为ajax 以执行ajax 表单提交。只有reRender 属性指定的元素会被刷新,而不是整个页面。

    或者,您可以将其更改为none(对于richfaces 3.X)或client(对于richfaces 4.0),这样就没有表单提交。

    <rich:menuItem submitMode="ajax">
        <a4j:commandLink
            value="Add Machine"
            oncomplete="#{rich:component('addMachinePanel')}.show()"
            reRender="addMachinePanel">
       </a4j:commandLink>
    </rich:menuItem>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多