Primefaces号码:阿贾克斯监听条件更新 [英] Primefaces p:ajax listener conditional update

查看:130
本文介绍了Primefaces号码:阿贾克斯监听条件更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JSF页面:

<p:commandButton>
  <p:ajax process="@this" update="name desc msg"
    listener="#{bean.deleteListener}"/>
</p:commandButton>

豆:

public void deleteListener() {
  if (data.size() == 0) {
    // updates only "msg"
    setMsg("There is no data to delete");
    return;
  }
  setMsg("Data deleted.");
  // and updates the bean values for "name" and "desc" also.
  ...
}

是否有可能基于AJAX的监听器逻辑Ajax调用有条件地更新。我想更新客户端ID名递减味精有条件的,如下面的听众code所示(请注意这是一个更大的应用程序中的示例场景)。该应用程序使用Primefaces 5.感谢。

Is it possible to conditionally update for an ajax call based on ajax listener logic. I would like to update the client ids "name desc msg" conditionally as shown in the listener code below (note this is a sample scenario in a larger application). The application uses Primefaces 5. Thanks.

推荐答案

@Kukeltje:感谢您的答复。但是,没有解决不了的问题。我曾尝试这一点,并找到其他的解决方案相关的网络论坛primefaces / AJAX /有条件的更新;他们并不适用于阿贾克斯听众的问题我已经张贴在这个岗位。我已经通过一些其他的手段/解决方法解决了问题。

@Kukeltje: Thanks for the reply. But, that did not solve the issue. I did try this and other solutions found online forums related to primefaces/ajax/conditional updates; they did not apply to the ajax listener issue I had posted in this post. I have resolved the issue through some other means/workaround.

这篇关于Primefaces号码:阿贾克斯监听条件更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆