Thank you very much for the help. I'm now using onError() like I should be
I've also got the requisite error messages setup in the appropriate .properties 
file. 

Thanks again for the assistance,
Tom

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Friday, August 07, 2009 11:03 AM
To: Burton, Tom F (DOR)
Subject: Re: wicket 1.2.7 login error checking and reporting

that code is pretty horrible, you should be using wicket's built in
validation instead of all that garbage.

anyways, it fails because passwordtextfield is required by default.
what this means is that if you leave it empty it will cause a form
validation error. onsubmit will not be called, instead button's
onerror will be called, where you should add the feedbackpanel to the
target to see the errors. you can also try
passwordfield.setrequired(false) and it might revert to working like
other textfields.

-igor

On Fri, Aug 7, 2009 at 11:47 AM, Burton, Tom F
(DOR)<tom.bur...@alaska.gov> wrote:
> It works for Login Failures, and blank usernames. It just doesn't
> work for blank passwords or blank username and password.
>
> Why would the error() function work for user==null but not password==null?
> My embarrassing log.debug line doesn't even fire, when there is no password.
> Which is why I'm not sure whatever code the server runs once I hit submit 
> doesn't get as far is this code without a password to verify.
>
> Here is a code snippet:
>
> form.add(new IndicatingAjaxSubmitButton("login", form)
> {
>        private static final long serialVersionUID = 1L;
>        public void onSubmit(AjaxRequestTarget target, Form form)
>        {
>                //set user as a non myalaska user so it will log out to this 
> page...
>                ((QuickStartSession)getSession()).setMyAkUser(false);
>                User userLoggingIn = null;
>
>                target.addComponent(feedbackpanel);
>                target.addComponent(form);
>
>              String user_error = "'User Name' is a requied field";
>              String passwd_error = "'Password' is a required field";
>
>                //TODO: Delete this line once blank/empty passwd format 
> verified
>                log.debug("Login AS: " + user + " : " + password);
>
>                if ( user == null && ( password == null ||
>                        password.trim().equals("") ) )
>                {
>                        error( user_error + "<br/>\n" + passwd_error );
>              }
>
>                else if (user == null)
>                {
>                        //log.error("'User Name' is a requied field");
>                        error( user_error );
>                        //return;
>                }
>
>        else if (password == null || password.trim().equals("") )
>        {
>          log.error("'Passwd' is a requied field");
>          error( passwd_error );
>          //return;
>        }
>        //else { log.info("username and password entered."); }
>                //end the if else if block;
>
>        //end processing if username or password errors
>        if ( user == null || password == null
>            || password.trim().equals("") )
>        { return; }
>
>
> Thanks for the help and patience,
> Tom B.
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
> Sent: Friday, August 07, 2009 10:23 AM
> To: Burton, Tom F (DOR)
> Subject: Re: wicket 1.2.7 login error checking and reporting
>
> right, there is no wicketfilter in 1.2.x, only wicketservlet.
>
> if you get empty <ajaxresponse> back then maybe you are forgetting to
> update the feedback panel using ajaxrequesttarget.
>
> -igor
>
> On Fri, Aug 7, 2009 at 11:08 AM, Burton, Tom F
> (DOR)<tom.bur...@alaska.gov> wrote:
>> I found wicketSessionFilter but not wicketFilter.  How would using
>> A regular submit button make a difference. I know submit request goes to the 
>> "server"  I just get an empty pair of <ajaxresponse> tags back from the 
>> server. (Firebug is really usefull, and I'm able to look at the post request 
>> I send thanks to TamperData).
>>
>> Thanks Again,
>> Tom
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
>> Sent: Thursday, August 06, 2009 11:57 AM
>> To: users@wicket.apache.org
>> Subject: Re: wicket 1.2.7 login error checking and reporting
>>
>> set a breakpoint in wicketfilter and see what its doing. does it work
>> properly when using a regular submit button?
>>
>> -igor
>>
>> On Thu, Aug 6, 2009 at 12:49 PM, Burton, Tom F
>> (DOR)<tom.bur...@alaska.gov> wrote:
>>> Hello,
>>>
>>>            I realize 1.2.7 is no longer "officially" supported.
>>> However, I'm hoping someone will help me anyway. Here goes nothing......
>>>
>>>
>>>
>>>
>>>            I have a login page that is supposed to make sure a username
>>> and password were actually entered before validating against the auth
>>> source.
>>>
>>> If the name and/or password aren't entered it's supposed to spit out an
>>> error message to the user.  It works when a password is entered but no
>>> username.
>>>
>>> If I enter a username and no password, or don't enter anything at all,
>>> nothing seems to happen. The spinning indicator next to the
>>> IndicatingAjaxSubmitButton
>>>
>>> goes by so fast I can't see it, if it goes by at all. My error log
>>> statements that tell me where its at in the execution don't seem to
>>> write out either.  I've tested this
>>>
>>> in both Firefox and IE. I also tested by entering a password in the form
>>> and then using the Tamper Data extension for Firefox to remove the
>>> password.  Still no joy.
>>>
>>> It seems that it's somewhere in the server side code that's terminating
>>> the request early but for the life of me I can't figure out where.
>>>
>>>
>>>
>>> Thanks for any help/assistance in this matter,
>>>
>>> Tom Burton
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to