Jsf 如何在单击p:commandButton时停止调用backingbean?

Jsf 如何在单击p:commandButton时停止调用backingbean?,jsf,primefaces,Jsf,Primefaces,我在p:datatable中使用p:commandButton。commandButton用于更新值。首先,当我单击commandButton时,它调用相应的更新方法。当我第二次单击commandButton时,正在调用dataTable backingbean方法,最后调用update方法 例如,我在dataTable中有多行。如果我单击第一行更新按钮,它将在db中更新。如果单击第二行更新按钮,它将调用dataTable backingbean方法,然后调用update方法 代码如下: <

我在p:datatable中使用p:commandButton。commandButton用于更新值。首先,当我单击commandButton时,它调用相应的更新方法。当我第二次单击commandButton时,正在调用dataTable backingbean方法,最后调用update方法

例如,我在dataTable中有多行。如果我单击第一行更新按钮,它将在db中更新。如果单击第二行更新按钮,它将调用dataTable backingbean方法,然后调用update方法

代码如下:

<p:commandButton value="Select"  
     id="ajaxBtn" 
     action="#{patientMedicineManageBean.selectDrugsImage}" 
     rendered="#{!(patientMedList.medicineImageId.length() eq null)}"  >
        <f:param name="imageName" value="#{patientMedList.imageName}"></f:param>
        <f:param name="medsId" value="#{patientMedList.id}"></f:param>

</p:commandButton>
谢谢。
任何帮助都将不胜感激。

问号在哪里?这不是字面意思,但是你的帖子缺少清晰易懂的问题描述。我得到了解决方案。我在方法末尾将列表设为null。现在我删除了它的工作状态良好。这就是为什么dataTable backing bean方法在单击commandButton时一直在调用。谢谢