Oracle ADF:richButton.setDisabled(true) 在 12c 中不工作

Oracle ADF: richButton.setDisabled(true) not working in 12c

您好,我正在使用 jdeveloper 12c。我有一个 test.jsf 页面,其中有一个带有按钮的表单。在此页面的支持 bean 中,我有 actionListener 方法 addKPI(ActionEvent e)。当用户单击此按钮时,它会调用 addKPI() 方法。在这种方法中,我正在做一些操作,然后我试图使用 richButton.setDisable(true) 禁用它。它在 12c 中不起作用。它在 jdeveloper 11.1.2.4 中工作。

请帮帮我。我如何实现这一目标。我的要求是当用户单击此按钮时我需要禁用它。表示按钮只能点击一次。

提前致谢。

您可以尝试从动作侦听器触发程序化 PPR:

public void addKPI(ActionEvent e) {
  .........
  richButton.setDisable(true);
  AdfFacesContext.getCurrentInstance().addPartialTarget(richButton);

}