confirmDialog successive calls do not trigger action

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
ozgurkurt
Posts: 13
Joined: 12 Apr 2016, 15:59

11 May 2017, 13:16

Hello,

I'm having an issue with global confirmDialog. When I load a page confirmDialog opens up and does the deed, however when I want to use it a second time on the page, dialog opens, however yes/no buttons don't work anymore. If I refresh the page (hit F5 in the browser), it works again once, and then not anymore until a page refresh. I tried different combinations none worked. Any ideas what could be wrong?

There is a form and datatable in it, in the header there is delete button, it has confirm dialog. ConfirmDialog buttons themselves are defined in the same form after the datatable.

Edit1: Sorry, it doesn't work at all. It must have something to do with form+table+update cascade. I'm totally annoyed now. Find below the source pls if you wanna help.

Regards,
Ozgur

Code: Select all

<h:form>

	<p:dataTable id="firmsTable" var="firm" value="#{companyView.firmsDM}" lazy="true" paginator="true" rows="10" paginatorPosition="bottom"
		paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport} {RowsPerPageDropdown}" selectionMode="single"
		selection="#{companyView.selectedFirm}" rowKey="#{firm}" draggableColumns="true" style="white-space: nowrap; margin-bottom: 20px; vertical-align: top;"
	rowsPerPageTemplate="10,50,100" sortMode="multiple">

	<f:facet name="header">
		<table>
			<tr>
				<td style="border-style: none">#{msg['titles.firms']}</td>
				<td style="border-style: none; width: 120px">
					<table>
						<tr>
							<td style="border-style: none">
								<p:commandButton icon="ui-icon-add" actionListener="#{firmDialog.insert()}"
									update="@([id$=firmDialogId])" oncomplete="PF('firmDialog').show()" />
							</td>
							<td style="border-style: none">
								<p:commandButton icon="ui-icon-pencil" actionListener="#{firmDialog.edit(companyView.selectedFirm)}"
									update="@([id$=firmDialogId])" oncomplete="PF('firmDialog').show()" disabled="#{companyView.selectedFirm eq null}" />
							</td>
							<td style="border-style: none">
								<p:commandButton icon="ui-icon-trash" actionListener="#{companyView.deleteFirm}" disabled="#{companyView.selectedFirm eq null}"
									update="@([id$=firmsTable]),@([id$=subFirmsTable])">
									<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
								</p:commandButton>
								<p:confirmDialog global="true" showEffect="fade" hideEffect="fade" width="300">
									<p:commandButton value="#{msg['words.yes']}" type="button" styleClass="ui-confirmdialog-yes GreenButton" icon="ui-icon-check" />
									<p:commandButton value="#{msg['words.no']}" type="button" styleClass="ui-confirmdialog-no RedButton" icon="ui-icon-close" />
								</p:confirmDialog>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</f:facet>

	<p:ajax event="rowSelect" update="@([id$=subFirmsTable]),@(button)" />
	<p:ajax event="rowUnselect" />

	<p:column sortBy="#{firm.firmID.name}" filterBy="#{firm.firmID.name}" filterMatchMode="startsWith" headerText="#{msg['fields.code']}">
		<h:outputText value="#{firm.firmID.name}" />
	</p:column>

	<p:column sortBy="#{firm.description}" filterBy="#{firm.description}" filterMatchMode="startsWith" headerText="#{msg['fields.desc']}">
		<h:outputText value="#{firm.description}" />
	</p:column>
	
</p:dataTable>

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

14 May 2017, 17:09

I think it isn't a Layout or theme issue. Please use PrimeFaces core forum; viewforum.php?f=3

Post Reply

Return to “Barcelona - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest