【问题标题】:"Please wait" message for <h:CommandButton><h:CommandButton> 的“请稍候”消息
【发布时间】:2014-03-03 15:52:10
【问题描述】:

如何为&lt;h:commandButton&gt; 显示“请稍候”消息? .我知道如何为&lt;a4j:____Button&gt; 显示这个modalPanel。

此请求针对现有应用程序的近 40 个页面,在 40 个页面中,其中 10 个使用 a4j:commandButton 和剩余的 h:commandButton 实现。在默认布局(图块)中添加 common a4j:status 解决所有a4j:commandbutton


&lt;h:commandbutton&gt; 转换为&lt;a4j:commandButton&gt; 并添加&lt;redirect&gt; 可以解决此问题,但还有其他方法可以实现吗?除了增加负载(单次提交的两个请求)之外的任何问题?


另一种解决方案是添加

`onclick = "Richfaces.showModalPanel('progressWaitModalPanel')"`

全部h:CommandButton 其中progressWaitModalPanel 是“请稍候”的modalPanel - 这种方法有什么问题吗?


如果需要,我想在一个地方实现并在每个页面中稍作修改,但对重构整个应用程序不感兴趣。


感谢您的宝贵时间。
环境:
Richfaces 3.1.6 , myfaces 1.1.7

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    据我了解:当用户单击h:commandButton 时,将显示“请稍候”面板。

    您是对的,在 Ajax-Requests 上,a4j:status 组件被触发并显示上述消息。对于普通/非 AJAX 页面请求,我不知道任何类似的机制(最后只有 h:commandButton)。

    就我个人而言,我要么选择你提到的onclick-solution(我猜有很多按钮要更改),要么尝试使用类似的东西

    <h:form onsubmit="Richfaces.showModalPanel('progressWaitModalPanel')">
       ...
    </form>
    

    这可能会减少要更改的地方的数量。

    希望对你有帮助...

    【讨论】:

    • 感谢您的宝贵时间。添加 onclik/onsubmit 不显示动画 gif(由于页面已提交,它没有动画)。但这一项减轻了更换所有按钮的负担
    猜你喜欢
    • 1970-01-01
    • 2015-01-17
    • 2012-09-12
    • 2022-08-16
    • 2011-09-02
    • 1970-01-01
    • 2012-05-30
    • 2014-05-12
    • 2011-05-12
    相关资源
    最近更新 更多