0
votes

I have a ajax event associated to a datatable that update 1 delete button. The button have a update tag for a dialog, like this:

<ui:insert id="itemDeleteDlg" name="dlg-delete-item"><ui:include src="/pages/admin/item/deleteItem.xhtml" /></ui:insert>

<h:form id="itemOptions" prependId="false">
    <h:commandLink type="button" styleClass="aui-button"
    onclick="openDialog('deleteItemDialog');return false;" update="@form :deleteItemForm">
</h:form>

<p:dataTable>
...
<p:ajax event="rowSelect" listener="#{itemBB.onRowSelect}" update="@form :itemOptions"/>
...
</p:dataTable>

The form deleteItemForm is inside ui:insert. When the rowSelect event is triggered the form itemsOptions is updated but when I click in the delete button the deleteItemForm isn't updated.

What I'm doing wrong?

1

1 Answers

1
votes

Your h:commandLink onclick property ends with 'return false', which effectively cancels the associated ajax call. Assuming you want to perform an ajax update of 'deleteItemForm', and then call 'openDialog', you should do this:

<p:commandLink type="button" styleClass="aui-button" update="@form :deleteItemForm"
  oncomplete="openDialog('deleteItemDialog')" />