Here is my commandButton inside a datatable column which job is to delete the associated line object:
<p:column style="width:6%;text-align:center"
headerText="Delete">
<p:commandButton icon="ui-icon-close"
title="Delete release #{release.name}"
actionListener="#{releaseBean.deleteRelease(release)}"
process="@this" update=":display :form2:releaseList">
<p:confirm
header="Confirm deleting release #{release.name}"
message="Are you really sure you want to delete release #{release.name}?"
icon="ui-icon-alert" />
</p:commandButton>
</p:column>
I want the name of the release to be displayed in the delete confirm message (Are you really sure you want to delete release "XYZ" ?).. But the problem is that the name of the release "XYZ" is not displayed nor in the header of <p:confirm>
neither in the message; but it's displayed in the <p:commandButton>
title.
What have I done wrong? Thank you.
EDIT:
I tried to modify the commandButton and add the setPropertyActionListener
:
<p:commandButton icon="ui-icon-close"
title="Delete release #{release.name}"
actionListener="#{releaseBean.deleteRelease(release)}"
process="@this" update=":display :form2:releaseList">
<f:setPropertyActionListener
target="#{gestionReleaseBean.selectedRelease}"
value="#{release}" />
<p:confirm
header="Confirm deleting release #{release.name}"
message="Are you really sure you want to delete release #{release.name}?"
icon="ui-icon-alert" />
</p:commandButton>
and in the bean I added the property selectedRelease
and it's getter/setter.
It didn't work...