You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alfredo Aleandri <al...@logobject.ch> on 2009/05/22 12:46:32 UTC

user input lost on first form submission

Hi all,
I have a simple sign-in page with a form and two fields (username and 
password)

    public LoginPage() {
        super();
        add(new SignInForm("signInForm"));       
    }

    private class SignInForm extends Form<Void> {
       
        private String username, password;
       
        public SignInForm(String id) {
            super(id);
            add(new TextField<String>("username", new 
PropertyModel<String>(this, "username")));
            add(new PasswordTextField("password", new 
PropertyModel<String>(this, "password")));
        }
       
        @Override
        protected void onSubmit() {
            // TODO Auto-generated method stub
            super.onSubmit();
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }
    }

if the user get the page directly, using the mounted url, all work as 
expected.
When the user get this page after a container redirection (I'm using 
form based servlet container authentication), on first form submission, 
the user entered data are not available (the sets are never called) but 
on the next submit all work as normal and models are updated.

The page is mounted using
mountBookmarkablePage("/login", LoginPage.class);

and the relevant part of the web.xml is
<form-login-page>/login</form-login-page>

Thank you

alf



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


Re: user input lost on first form submission

Posted by "alf.redo" <al...@logobject.ch>.

igor.vaynberg wrote:
> 
> are you sure the container is not interfering between you pressing the
> submit button and wicket processing the form input?
> 

Hi igor, thank you for your answer.
The container redirect the user to a wicket page, the form in this page does
not send user input on first submit (the onsubmit method is executed but
model are not updated).
If I submit the form again, it works. 

If I make a redirect just after the container redirection it works again
(this is the trick I have implemented actually).

Thank you for your suggestions...

-- 
View this message in context: http://www.nabble.com/user-input-lost-on-first-form-submission-tp23668260p23673429.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: user input lost on first form submission

Posted by Igor Vaynberg <ig...@gmail.com>.
are you sure the container is not interfering between you pressing the
submit button and wicket processing the form input?

-igor

On Fri, May 22, 2009 at 8:36 AM, alf.redo <al...@logobject.ch> wrote:
>
>
> igor.vaynberg wrote:
>>
>> sounds like the your security redirection is not keeping post params?
>>
>
> Hi igor,
> the problem is that the first form submission AFTER the container
> redirection is not keeping post params... :confused:
>
>
>
> --
> View this message in context: http://www.nabble.com/user-input-lost-on-first-form-submission-tp23668260p23673022.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: user input lost on first form submission

Posted by "alf.redo" <al...@logobject.ch>.

igor.vaynberg wrote:
> 
> sounds like the your security redirection is not keeping post params?
> 

Hi igor,
the problem is that the first form submission AFTER the container
redirection is not keeping post params... :confused:



-- 
View this message in context: http://www.nabble.com/user-input-lost-on-first-form-submission-tp23668260p23673022.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: user input lost on first form submission

Posted by Igor Vaynberg <ig...@gmail.com>.
sounds like the your security redirection is not keeping post params?

-igor

On Fri, May 22, 2009 at 3:46 AM, Alfredo Aleandri
<al...@logobject.ch> wrote:
> Hi all,
> I have a simple sign-in page with a form and two fields (username and
> password)
>
>   public LoginPage() {
>       super();
>       add(new SignInForm("signInForm"));         }
>
>   private class SignInForm extends Form<Void> {
>             private String username, password;
>             public SignInForm(String id) {
>           super(id);
>           add(new TextField<String>("username", new
> PropertyModel<String>(this, "username")));
>           add(new PasswordTextField("password", new
> PropertyModel<String>(this, "password")));
>       }
>             @Override
>       protected void onSubmit() {
>           // TODO Auto-generated method stub
>           super.onSubmit();
>       }
>
>       public String getUsername() {
>           return username;
>       }
>
>       public void setUsername(String username) {
>           this.username = username;
>       }
>
>       public String getPassword() {
>           return password;
>       }
>
>       public void setPassword(String password) {
>           this.password = password;
>       }
>   }
>
> if the user get the page directly, using the mounted url, all work as
> expected.
> When the user get this page after a container redirection (I'm using form
> based servlet container authentication), on first form submission, the user
> entered data are not available (the sets are never called) but on the next
> submit all work as normal and models are updated.
>
> The page is mounted using
> mountBookmarkablePage("/login", LoginPage.class);
>
> and the relevant part of the web.xml is
> <form-login-page>/login</form-login-page>
>
> Thank you
>
> alf
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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