PDA

View Full Version : [CLOSED] Passwords do not match



jtorroledo
Nov 13, 2012, 3:53 AM

Baidaly
Nov 13, 2012, 5:25 AM

jtorroledo
Nov 13, 2012, 12:00 PM

Baidaly
Nov 13, 2012, 2:15 PM
It happens because you are using MasterPage. Try to use following ConfigItem:


<ext:ConfigItem Name="initialPassField" Value="#{txtPassword.ConfigID}" Mode="Raw" />

And one more question, why aren't you using FormBind to disable form buttons?

jtorroledo
Nov 13, 2012, 9:07 PM
Excellent, it works well.

I will start using formbind.

Baidaly, Thanks for All.!!!!


Close the Thread

michaeld
Mar 24, 2013, 4:30 AM
May I make a suggestion to add this solution to the example, at least as a comment in the code indicating a different implementation is required if there is a master page? I spent hours trying to consider why the example code didn't work before I considered checking the forums.

Daniil
Mar 25, 2013, 6:25 AM
Hi @michaeld,

Thank you for the suggestion.

Well, if you put any control to a container which implements the INamingContainer interface, e.g. a UserControl or a MasterPage, a control's ClientID doesn't coincide ID anymore (by default). So, you should beware if you access components by its ids and use MasterPages and UserControls.

michaeld
Oct 10, 2013, 4:57 AM
I haven't tested this page in awhile, but the code you posted


<ext:ConfigItem Name="initialPassField" Value="#{txtPassword.ConfigID}" Mode="Raw" />

breaks in the current trunk. This is a show-stopper for me.

michaeld
Oct 10, 2013, 5:11 AM
Seems this may be working now?


<ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Raw" />

Daniil
Oct 10, 2013, 5:31 AM
I haven't tested this page in awhile, but the code you posted


<ext:ConfigItem Name="initialPassField" Value="#{txtPassword.ConfigID}" Mode="Raw" />

breaks in the current trunk. This is a show-stopper for me.

It appears to be working in the test case below.

Example

<%@ Page Language="C#" MasterPageFile="~/Site1.Master" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<ext:TextField
ID="TextField1"
runat="server"
FieldLabel="Password"
InputType="Password" />

<ext:TextField
runat="server"
FieldLabel="Repeat"
Vtype="password"
InputType="Password">
<CustomConfig>
<ext:ConfigItem Name="initialPassField" Value="#{TextField1.ConfigID}" Mode="Raw" />
</CustomConfig>
</ext:TextField>
</asp:Content>



Seems this may be working now?


<ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Raw" />


I think it still doesn't work.

michaeld
Oct 10, 2013, 5:44 AM
If you wish to see the error I am getting, go to my website and click New User Button.

When I remove .ClientID it works again (on dev). I can't explain why. Master page is still in place. That's the top row on my page.

I'm going to post a new deployment to the production server in a few hours.

Daniil
Oct 10, 2013, 6:07 AM
When I remove .ClientID it works again (on dev).

ConfigID or ClientID? I think it should not work with ClientID. There should be ConfigID. So, did you try with ConfigID?

michaeld
Oct 10, 2013, 6:24 AM
Sorry. That was my typo in the last response. Check the site, it's output rendering the following and causing an exception:


"initialPassField": #{Password.ConfigID},

Transform isn't converting this.

michaeld
Oct 10, 2013, 6:43 AM
The only thing I can think that might be different with this code is I'm using the caps lock detector on Password.

I'm trying to figure it out but this one is a show-stopper. Without the ConfigID working, I can't confirm the ConfirmPassword.




<%@ Page Language="C#" MasterPageFile="~/main.master" AutoEventWireup="true" %>


<%@ OutputCache NoStore="true" Location="None" %>
<%@ Register Src="../ctl/Captcha.ascx" TagName="Captcha" TagPrefix="sc" %>


<asp:Content ID="h" ContentPlaceHolderID="head" runat="Server">
<title>SceneCalendar Create User Account</title>
</asp:Content>


<asp:Content ID="c" ContentPlaceHolderID="cp" runat="Server">


<ext:Panel ID="Panel1" runat="server" Layout="HBoxLayout" Border="false" BodyCls="BodyFrame">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>


<ext:FormPanel ID="UserF" runat="server" Width="400" Border="false" BodyCls="BodyFrame" DefaultButton="Submit">
<Items>


<ext:Panel ID="UserP" runat="server" Title="Create your New User ID" BodyPadding="5" Frame="true">
<Defaults>
<ext:Parameter Name="msgTarget" Value="under" />
</Defaults>
<Items>


<ext:TextField ID="UserName" runat="server" FieldLabel="User Name" AllowBlank="false"
MinLength="5" MaxLength="256" EnforceMaxLength="true" EmptyText="Login name" Width="380" />
<ext:TextField ID="Password" runat="server" FieldLabel="Password" AllowBlank="false"
MinLength="8" MaxLength="128" EnforceMaxLength="true" InputType="Password" Width="380">
<Plugins>
<ext:CapsLockDetector ID="CapsLockDetector1" runat="server">
<Listeners>
<CapsLockOn Handler="#{Password}.showIndicator({iconCls : '#Error', tip : 'CapsLock is on'});" />
<CapsLockOff Handler="#{Password}.hideIndicator();" />
</Listeners>
</ext:CapsLockDetector>
</Plugins>
</ext:TextField>
<%--!!ADD Password Strength Control --%>
<ext:TextField ID="ConfirmPassword" runat="server" FieldLabel="Confirm PW" AllowBlank="false"
MinLength="8" MaxLength="128" EnforceMaxLength="true" InputType="Password" Vtype="password" Width="380">
<CustomConfig>
<ext:ConfigItem Name="initialPassField" Value="#{Password.ConfigID}" Mode="Raw" />
</CustomConfig>
</ext:TextField>


</Items>
</ext:Panel>




</Items>
<Buttons>


<ext:Button ID="Submit" runat="server" Text="Create User" Disabled="true">
<DirectEvents>
</DirectEvents>
</ext:Button>


<ext:Button ID="Cancel" runat="server" Text="Cancel">
<Listeners>
<Click Handler="(new Url('/', '', 'http')).redir();" />
</Listeners>
</ext:Button>


</Buttons>
<Listeners>
<ValidityChange Handler="#{Submit}.setDisabled(!valid);" />
</Listeners>
</ext:FormPanel>


<ext:Panel ID="Panel2" runat="server" Title="Help" Flex="1" BodyPadding="5" Border="false" Frame="true" Margins="0 0 0 2px">
<Content>
Create or Edit Existing User Account.
</Content>
</ext:Panel>


</Items>
</ext:Panel>
</asp:Content>

Daniil
Oct 10, 2013, 8:52 AM
The only thing I can think that might be different with this code is I'm using the caps lock detector on Password.

Does it work without a CapsLockDetector?

michaeld
Oct 10, 2013, 9:50 AM
Nope. I removed it from the sample above and same effect.
Were you able to reproduce?
If I can figure out where to trap the code in ext.net for the transform, I could look more closely

Daniil
Oct 10, 2013, 3:00 PM
I reproduced. With my example as well. Not sure why I could not reproduce it initially. Maybe, v2.2 dlls were cached.

Anyway, we are investigating.

For now you can use the following solution.

<ext:ConfigItem Name="initialPassField" Value="#{Password}" Mode="Raw" />
and

Ext.apply(Ext.form.VTypes, {
password : function (val, field) {
if (field.initialPassField) {
var pwd = Ext.isString(field.initialPassField) ? Ext.getCmp(field.initialPassField) : field.initialPassField;

if (pwd) {
if (pwd.processRawValue) {
return pwd ? (val === pwd.processRawValue(pwd.getRawValue())) : false;
}
else {
return pwd ? (val === pwd.getRawValue()) : false;
}
}

return false;
}

return true;
}
});

By the way, I committed the script override to the SVN trunk.

Daniil
Oct 10, 2013, 5:08 PM
This has been fixed in the trunk.

Value="#{TextField1.ConfigID}"

michaeld
Oct 10, 2013, 11:18 PM
No more show-stoppers. I may be able to launch this week.