私はこのダイアログを持っています:
<p:dialog header="Commande editée le #{acceuilUserController.selectedMajCommande.dateMaj} par l'#{acceuilUserController.selectedMajCommande.utilisateur.type} #{acceuilUserController.selectedMajCommande.utilisateur.nom} #{acceuilUserController.selectedMajCommande.utilisateur.prenom}" widgetVar="carDialog" resizable="false" id="carDlg"
update="cars" showEffect="fade" hideEffect="explode" modal="true">
ユーザーがデータテーブルの下のボタンをクリックすると表示されます。
<p:column style="width:40px">
<p:commandButton id="selectButton" action="#{acceuilUserController.refresh()}" update=":form:carDlg" oncomplete="carDialog.show()" icon="ui-icon-search" title="plus de détails">
<f:setPropertyActionListener value="#{car}" target="#{acceuilUserController.selectedMajCommande}" />
</p:commandButton>
</p:column>
ユーザーがダイアログを閉じると、以下のメソッドが実行されます。
public String refresh(){
this.selectedMajCommande.setLu(true);
System.out.println("je suis la alors : "+this.selectedMajCommande.isLu());
hch.updateCommandeMaj(selectedMajCommande);
return "acceuil";
}
データをデータテーブルに更新することができます。次のようなダイアログのボタンでこれを作成することに成功しました:
<p:commandButton id="confirm" value="fermer" update="cars" oncomplete="carDialog.hide()"
action="#{acceuilUserController.refresh()}" />
しかし、ボックス内のこのボタンを必要とせずに、ダイアログを閉じるときにのみこれを行いたい
更新したいデータテーブルは次のとおりです。
<p:dataTable id="cars" var="car" value="#{acceuilUserController.lc_maj}" tableStyle="width:auto" rowStyleClass="#{(car.lu == false) ? 'red' : null}" >
<p:column headerText="Commande N° : " style="width:100px">
<h:outputText value="#{car.commande.id}" />
</p:column>
<p:column headerText="Date de mise à jour : " style="width:100px">
<h:outputText value="#{car.dateMaj}" />
</p:column>
<p:column headerText="Decision : " style="width:100px">
<h:outputText value="#{car.decison}" />
</p:column>
<p:column headerText="Etat : " style="width:100px">
<h:outputText value="#{car.etat}" />
</p:column>
<p:column style="width:40px">
<p:commandButton id="selectButton" action="#{acceuilUserController.refresh()}" update=":form:carDlg" oncomplete="carDialog.show()" icon="ui-icon-search" title="plus de détails">
<f:setPropertyActionListener value="#{car}" target="#{acceuilUserController.selectedMajCommande}" />
</p:commandButton>
</p:column>
</p:dataTable>
どうすればこれを達成できますか、事前に感謝します