Problem oncomplete on dialog

UI Components for JSF
Post Reply
pere.abello
Posts: 4
Joined: 05 Dec 2014, 10:11

10 Dec 2014, 11:09

Hi,

I am migrating to Primefaces 5.1 and I find a problem on dialogs.
When I navigate to other page from the dialog, it fails.
The dialog disappear, but the backend is still grey and disabled.
A sample xhtml code to reproduce it:

mainView.html:

Code: Select all

<?xml version="1.0"?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head />
	<h:body>
		<h:form>
			<p:commandButton value="Open dialog" oncomplete="PF('myDialog').show()"></p:commandButton>
			<p:commandButton value="Go To Page1" action="#{myBean.goToPage1()}"></p:commandButton>
			<p:dialog id="myDialog" widgetVar="myDialog"
				header="Dialog test navigation" resizable="false" modal="true"  width="600" closable="false">		    		    	
				<p:commandButton value="Go To Page1" oncomplete="PF('myDialog').hide()" action="#{dtFilterView.goToPage1()}"></p:commandButton>
				<p:commandButton value="Close" oncomplete="PF('myDialog').hide()"></p:commandButton>
			</p:dialog>
		</h:form>
	</h:body>
</f:view>
page1.html:

Code: Select all

<?xml version="1.0"?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head />
	<h:body>
		<h:form>
				<h:outputText  value="This is Page 1"></h:outputText>
				<p:commandButton value="Go To Home" action="#{myBean.goToHome()}"></p:commandButton>
		</h:form>
	</h:body>
</f:view>
In myBean, there are only two methods ("goToPage1" and "goToHome") to navigate to each page.

Steps to reproduce the problem:
1. Click on "Open dialog" (on mainView.xhtml)
2. Click on button "Go To Page1" from the dialog
3. The dialog is closes and navigates to "page1.xhtml" , but no more can be done (all is disabled).
Class style still is "ui-widget-overlay".

I found that there is a JavaScript error in the browser console:
  • Uncaught TypeError: Cannot read property 'hide' of undefined view.xhtml:5
    PrimeFaces.ab.oncomplete jquery.js?ln=primefaces&v=5.1:25
    i jquery.js?ln=primefaces&v=5.1:25
    cd.fireWith jquery.js?ln=primefaces&v=5.1:25
    cgj query.js?ln=primefaces&v=5.1:25
    i query.js?ln=primefaces&v=5.1:25

Thanks

Pere Abelló

--------------------------------------------------
Primefaces 5.1
Jboss 6.1
JSF 2.1
Windows 7

lanokims
Posts: 5
Joined: 21 Jun 2014, 20:29

09 Jan 2018, 17:00

Hello,

Please did you find any solution on this problem?

I have the same problem with primeface 6.1

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

09 Jan 2018, 18:08

The error/issue cannot be deduced from what is posted. Please post a real [mcve] http://stackoverflow.com/help/mcve so we can check what is going on.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: basshamut and 34 guests