primefaces: Dialog: showing dialog on complete after update does not work the first time on jQuery 3

1) Environment

2) Expected behavior

Dialog should be shown right after button was clicked

3) Actual behavior

The screen splashes the first time

4) Steps to reproduce

Clicking modal2

image

5) Sample XHTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html">

<f:view contentType="text/html">
	<h:head>
	</h:head>
	<h:body>

		<h:form id="mainForm">

			<p:commandButton value="Modal 2"
				oncomplete="PF('dlg2').show();" update="dialog2"/>
				
			<p:commandButton value="Modal 3"
				oncomplete="PF('dlg2').show();" update="dialog3"/>

			<p:dialog id="dialog2" header="Modal Dialog" widgetVar="dlg2"
				modal="true" minimizable="true" maximizable="true" height="100">
				<h:outputText value="This is a Modal Dialog." />
			</p:dialog>
			
			<p:dialog id="dialog3" header="Modal Dialog" widgetVar="dlg3"
				modal="true" minimizable="true" maximizable="true" height="100">
				<h:outputText value="This is a Modal Dialog." />
			</p:dialog>

		</h:form>

	</h:body>
</f:view>

</html>

6) Analysis

This regression is caused by https://github.com/primefaces/primefaces/commit/fc9eda2bdf7852523f553e26a52413f2d6c741b5 (https://github.com/primefaces/primefaces/issues/3062)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Fixed now. Could you please test this fix? It works fine for me.

I’ll check it.