password inside a dialog

UI Components for JSF
zorba
Posts: 35
Joined: 29 Jun 2010, 19:52

08 Jul 2010, 21:41

hi there
i'm using primfaces 2.1RC1 with JSF 2.0.2 FCS (mojarra) and got a problem with password component.
i got a <p:password> inside a dialog, and when open the dialog, the password strenght looks like this:
Image

my code:

Code: Select all

	<p:dialog widgetVar="changePasswd" header="#{msg.mudarPasswd}"
		modal="true" draggable="true" resizable="false">
		<p:growl id="senhaGrowl" />
		<h:form id="alterarSenha">
			<h:panelGrid columns="2">
				<h:outputText value="#{msg.novaSenha}" />
				<p:password value="#{managedUsuario.senha}" required="true" />

				<h:outputText value="#{msg.confirmarSenha}" />
				<p:password value="#{managedUsuario.confirmarSenha}" required="true" />

				<p:commandButton value="#{msg.ok}" update="senhaGrowl" 
					action="#{managedUsuario.alterarSenha}" />
			</h:panelGrid>
		</h:form>
	</p:dialog>

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

09 Jul 2010, 08:55

try wrapping
<h:outputText value="#{msg.novaSenha}" />
<p:password value="#{managedUsuario.senha}" required="true" />

and
<h:outputText value="#{msg.confirmarSenha}" />
<p:password value="#{managedUsuario.confirmarSenha}" required="true" />
inside a <h:panelGroup>
like :

Code: Select all

<h:panelGroup layout="block">
     <h:outputText value="#{msg.novaSenha}" />
     <p:password value="#{managedUsuario.senha}" required="true" />
</h:panelGroup>
Last edited by michiel on 09 Jul 2010, 14:00, edited 1 time in total.
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

zorba
Posts: 35
Joined: 29 Jun 2010, 19:52

09 Jul 2010, 13:24

thanks for you reply, but it doesn't worked
the password strenght metter stays on top :(

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

09 Jul 2010, 13:31

Seems like a positioning issue of password as it does not update it's initial position, try an inline password instead of an overlay one to see if it works.

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

09 Jul 2010, 14:01

this will work fine, tested it :

Code: Select all

<p:password value="#{managedUsuario.senha}" required="true" inline="true" />
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

zorba
Posts: 35
Joined: 29 Jun 2010, 19:52

09 Jul 2010, 14:12

with panelGroup? without?

zorba
Posts: 35
Joined: 29 Jun 2010, 19:52

09 Jul 2010, 14:19

Image
the password strenght is duplicated.

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

09 Jul 2010, 14:42

strange, maybe setting id's will help,
I tested it (with different id's) and I got an indicator for each <p:password>
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

zorba
Posts: 35
Joined: 29 Jun 2010, 19:52

09 Jul 2010, 14:52

i've tried this too, but still won't work
my code:

Code: Select all

	<div id="dialogoSenha">
		<p:dialog widgetVar="changePasswd"
		header="#{msg.mudarPasswd}" modal="true" draggable="true"
		resizable="false" width="450">
		<p:growl id="senhaGrowl" />
		<h:form id="alterarSenha">
			<h:panelGrid columns="2">

					<h:outputText value="#{msg.novaSenha}" />
					<p:password id="passwd" value="#{managedUsuario.senha}" required="true" inline="true"/>

					<h:outputText value="#{msg.confirmarSenha}" />
					<p:password id="confirmaPasswd" value="#{managedUsuario.confirmarSenha}"
						required="true" inline="true"/>
						
				<p:commandButton value="#{msg.ok}" update="senhaGrowl"
					action="#{managedUsuario.alterarSenha}" />
			</h:panelGrid>
		</h:form>
	</p:dialog></div>
sorry about my english :oops:

User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

11 Jul 2010, 19:53

enclose your dialog with a <p:outputPanel> and update the outputPanel when you show your dialog.
Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 56 guests