p:dialog does not close after onclick event

UI Components for JSF
Post Reply
marcelocaser
Posts: 122
Joined: 13 Dec 2011, 15:07

13 Dec 2011, 15:18

Hello,

I have a component of type Dialog:

Code: Select all

<!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:composite="http://java.sun.com/jsf/composite"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:body>
	<composite:interface>
	</composite:interface>

	<composite:implementation>
		<p:dialog modal="true" widgetVar="statusDialog" showHeader="false"
			draggable="false" closable="false" resizable="false">
			<p:graphicImage value="#{msg.pbpfBarraAjax}" />
		</p:dialog>
	</composite:implementation>
</h:body>
</html>
In my login page I call my dialog like this:

Code: Select all

<p:commandButton value="#{msg.login}" onclick="statusDialog.show()" action="#{loginBean.logon}" image="ui-icon ui-icon-unlocked" ajax="false" />
In my component Dialog, version PF M4, closed after a field validation. But component Dialog, in version PM RC1, remains on the screen and does not execute any action validation, for example.

What am I doing wrong?

marcelocaser
Posts: 122
Joined: 13 Dec 2011, 15:07

20 Dec 2011, 14:41

Hi,

When I use p:menuitem and onckick="statusDialog.show();" is it work fine. My p:dialog close after event.

Code: Select all

<h:form prependId="false">
	<p:menubar>
		<p:submenu label="#{msg.pbpfMenuFrente}" icon="iconeMenuFrente">
			<p:submenu label="#{msg.pbpfMenuMovimento}" icon="iconeMenuFrenteMovimento">
				<p:menuitem value="#{msg.pbpfMenuMovimentoProcessaVenda}"
					onclick="statusDialog.show();" action="#{frenteBean.novo}"
					ajax="false" />
			</p:submenu>
		</p:submenu>
	</p:menubar>
</h:form>
Maybe p:commandButton have some bug with onclick property?!!

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

20 Dec 2011, 17:09

Menuitems with ajax="false" will generate a page refresh.
The action will be processed in order to determine which page should be served next.
Your onclick can never be called because the page it would be called on is being unloaded or the new page has been sent to the browser.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

marcelocaser
Posts: 122
Joined: 13 Dec 2011, 15:07

20 Dec 2011, 18:18

andyba wrote:Menuitems with ajax="false" will generate a page refresh.
The action will be processed in order to determine which page should be served next.
Your onclick can never be called because the page it would be called on is being unloaded or the new page has been sent to the browser.
Ok,

But because the M4 version <p:commandButton ajax="false"/> works normally?! :?: :?: :?:

marcelocaser
Posts: 122
Joined: 13 Dec 2011, 15:07

23 Dec 2011, 20:16

Hi again,

When i set modal="false" it work perfectly, but i need use modal="true" :!: :!: :!: :!:

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests