【问题标题】:Can I delay the a4j:commandButton 's action when using accesskey to click it?使用 accesskey 单击时,我可以延迟 a4j:commandButton 的操作吗?
【发布时间】:2023-04-04 21:09:01
【问题描述】:

我有一个h:inputText,它会在 onchange() 事件发生时调用后端方法,

<h:inputText>
    <a4j:support event="onchange" action="#{mBean.onInputChange}" />
 </h:inputText>

我有一个 a4j:commandButton 将执行保存过程。 a4j:commandButton 也有分配给它的热键

<a4j:commandButton  accesskey="s"   action="#{mBean.performSave}" />

当我在 h:inputText 中键入文本,然后按“Alt+s”单击按钮时,mBean.performSave()mBean.onInputChange() 将同时运行。我可以延迟mBean.performSave() 的操作,使mBean.performSave()mBean.onInputChange() 完成后运行吗?

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    Richfaces 提供了一个&lt;a4j:queue&gt; 组件,可以用于处理您的场景。

    【讨论】:

      【解决方案2】:

      您可以尝试使用&lt;a4j:queue&gt;

      【讨论】:

        猜你喜欢
        • 2015-10-06
        • 1970-01-01
        • 1970-01-01
        • 2012-04-23
        • 1970-01-01
        • 2012-04-16
        • 2021-10-15
        • 1970-01-01
        • 2019-11-15
        相关资源
        最近更新 更多