【问题标题】:Progress popup showing up after cancelling action in the confirmation popup在确认弹出窗口中取消操作后显示进度弹出窗口
【发布时间】:2021-03-28 20:57:24
【问题描述】:

我编写了以下代码,以在删除用户时显示确认弹出窗口。此外,我还附上了此操作的进度弹出窗口(也与其他页面相关联)。

但由于它们都是 onclick,即使在确认弹出窗口中取消操作后,也会出现进度弹出窗口。我尝试将进度弹出窗口与其他事件(如“开始”)附加,但在执行操作时它不会显示。

下面是我的代码:

<div class="bt btDelete">
    <h:commandLink id="idDeleteUser" action="deleteUser" title="#{msg.btn_delete_user}"
                rendered="#{not user.completed and not empty user.id}" 
                onclick="if(confirm('#{msg.action_ask_delete_user}')) {return true;} else {return false;}">
        <span class="btleft" />
        <span class="btmiddle">#{msg.btn_delete_user}</span>
        <span class="btright" />
        <span class="clear" />
        <rich:componentControl for="inProgressPopup" attachTo="idDeleteUser" operation="show" event="start"/>
    </h:commandLink>
</div>

我应该以最少的更改进行哪些更正?

【问题讨论】:

    标签: jsf richfaces commandlink


    【解决方案1】:
    if(confirm('#{msg.action_ask_delete_user}')) {return true;} else {return false;}
    

    您也可以在此处关闭弹出窗口,而不仅仅是 return false

    #{rich:component('id').close()}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-02-20
      • 1970-01-01
      • 2022-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-10
      相关资源
      最近更新 更多