New Posts New Posts RSS Feed: Password Boxes in Registration Form
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Password Boxes in Registration Form

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: Password Boxes in Registration Form
    Posted: 31-Mar-2011 at 4:41pm
I am using the DevForce Biz App template to create a new project.
 
I enter a connection string to a ASPNETDB.
 
I then run the app, click the register button and try to register.
 
If the two passwords match the first time, all is fine.  However, if they do not match, the top password box stays red even when the two passwords do match.  The second password box does change back to normal status.  The only way to resolve is to close the registration form and get it right the first time.  I looked at the code that does the verification, but I couldn't resolve what the issue is.
 
Greg
 
 
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 01-Apr-2011 at 9:47am
Greg,

I see what you're talking about, and will look into it. The template may need some additional code in order to clear the error condition from both boxes. I'll update you when I've got it resolved.

--Robert
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 01-Apr-2011 at 12:43pm
Thanks Robert.
 
Greg
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 04-Apr-2011 at 3:13pm
Greg,

The template lacks the logic to clear errors when there are two triggers for a given validation test. You should be able to resolve this by making the two following changes to your VerifiableObject class:

Add this method:

        public void RemoveError(VerifierResult result)
        {
            ValidationErrors.Remove(result);
            GetPropertyNames(result).ForEach(OnErrorsChanged);
        }

Replace ClearErrors(string propertyName) with:

        private bool ClearErrors(string propertyName)
        {
            var remove = ValidationErrors.Where(vr => GetPropertyNames(vr).Contains(propertyName)).ToList();
            remove.ForEach(r => RemoveError(r));
            return remove.Count > 0;
        }
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 06-Apr-2011 at 12:12pm
Great thanks, that works.
 
Greg
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down