Page 1 of 2

[BUG] 3.0.RC2 dialog not centered vertically!

Posted: 25 Dec 2011, 18:03
by djmj
JSF - Mojarra 2.0
Server - Glassfish 3.01 web

If i define a dialog like: (using position with center gives same result)

Code: Select all

<p:dialog id="dlg" header="dialog" widgetVar="dlgVar" 
	width="575" height="650" resizable="false" modal="true">
	<!-- content -->
</p:dialog>
Edit: it does not get vertically centered, only horizontally.

In showcase it is centered both vertically and horizontally. http://www.primefaces.org/showcase-labs ... Dialog.jsf

Re: [BUG] 3.0.RC2 dialog sets defined height to auto in html

Posted: 25 Dec 2011, 18:11
by cagatay.civici
It's expected, look in the dom of dialog in more detail. You'll find out why.

Re: [BUG] 3.0.RC2 dialog sets defined height to auto in html

Posted: 25 Dec 2011, 19:11
by djmj
ok i think i found what you meant, but it does not changes the fact that vertically the dialog is not centered.

Sorry i did not made that clear in my post, if you need full code i can post it. (edited first post)

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 26 Dec 2011, 01:12
by cagatay.civici
Try with 3.0 snapshot.

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 12 Mar 2012, 17:52
by ermal
I have same problem centering dialogs in my web application.

The dialogs defined as below are not centered in the page (Worst case is when I have a table with many records the dialog disappeared)

<p:confirmDialog widgetVar="confirmation" width="400" severity="alert" position="center">
....
</p:confirmDialog >


Is this a bug? There is any known workaround to avoid this?

Thanks in advance for any clarification on this matter.
Ermal

Primefaces: 3.0 final
Jsf: Mojarra 2.0.3-FCS
Server: Tomcat7
Browser: Firefox 10.0.2

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 12 Mar 2012, 17:57
by cagatay.civici
Can you replicate at showcase? It has lots of dialogs.

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 12 Mar 2012, 18:23
by ermal
In showcase the dialogs seems fine. Tag position="center" is not even used...

Am I missing something on how to use appropriately the confirm dialogs?

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 23 Mar 2012, 22:15
by torquatro
I had the same problem.

My page is large vertically, so when using op: confirmDialog it is not shown.

Checking the source code, I found the css attribute "top" was the value 980px. But my page has a maximum of 900px.
Then the confirmDialog is not shown.

I solved this as follows:

Code: Select all

confirmation.content.parent().css('top',  '100px');
on this part

Code: Select all

<p:commandButton disabled="#{ not empty pedidoBean.pedido.notaFiscal or empty pedidoBean.pedido.id }" 
		value="Gerar Nota Fiscal" image="ui-icon-arrowthick-1-ne"
		onclick="confirmation.show(); confirmation.content.parent().css('top',  '100px');" type="button"/>	
	
	
	<p:confirmDialog message="Realmente deseja gerar uma Nota Fiscal a partir desse pedido? (O pedido não poderá mais ser alterado)" modal="true"
				header="Atenção" widgetVar="confirmation" showEffect="fade">
		<p:commandButton value="Sim" oncomplete="confirmation.hide(); geracaoNotaCompleta(xhr, status, args);"
					action="#{ pedidoBean.gerarNotaFiscal }" image="ui-icon ui-icon-check"/>
		<p:commandButton value="Não" onclick="confirmation.hide()" type="button" image="ui-icon ui-icon-close" /> 
	</p:confirmDialog>


Any suggestion?

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 24 Mar 2012, 03:18
by tandraschko
Try with a new version. 3.2 is already released.

Re: [BUG] 3.0.RC2 dialog not centered vertically!

Posted: 17 Apr 2015, 15:59
by felipecaparelli
I have this problem too. But it occurs when I try to reuse the same dialog with different callers (and messages). The confirmDialog doesn't reset the position, generated in the first time it was opened. Do you have any suggestion to reset the confirmDialog position when it is reopened?