I have RequestScoped bean because I'm redirecting the user from dataTable with records to edit page. In this dataTable I have delete buttons:
<p:column>
<p:commandButton update=":deleteNewsDialog" oncomplete="deleteNewsDlg.show()" icon="ui-icon-closethick">
<f:setPropertyActionListener value="#{news}" target="#{newsBean.news}" />
</p:commandButton>
</p:column>
And here is the dialog:
<p:confirmDialog id="deleteNewsDialog" message="Czy na pewno chcesz usunąć wiadomość o tytule "#{newsBean.news.title}"?"
header="Usuwanie wiadomości" severity="alert"
widgetVar="deleteNewsDlg" appendToBody="true">
<h:form>
<p:commandButton value="Usuń" actionListener="#{newsBean.delete}" update=":newsesTableForm:newsesTable, :newsesTableForm:newsGrowl"/>
<p:commandButton value="Anuluj" oncomplete="deleteNewsDlg.hide();"/>
</h:form>
</p:confirmDialog>
When newsBean.delete is fired, newsBean not longer exists so I get a lot of ugly validation exceptions. I have other pages like this with ViewScoped beans and there it is working like a charm. Help?