On Mon, Sep 19, 2011 at 1:32 PM, aabfattah
<ahmed.abdelfattah.elshem...@gmail.com> wrote:
> Hello ,
> I have reused the code of the SignInPanel to make another class with Arabic
> support then I added a button to signup for new user inside the sign in form
> but this button doesn't work and doesn't throw any exceptions
>
> *I made a system.println inside the button onSubmit() method and it prints
> in console but it doesn't do a redirect .
I guess it does redirect but then the authentication check makes
another redirect to the login page.
Check Firebug's logs in Net tab.
> *
> //From SignInPanel.java
>
>         */
>                public SignInForm(final String id) {
>                        super(id);
>
>                        setModel(new 
> CompoundPropertyModel<SignInPanel>(SignInPanel.this));
>
>                        // Attach textfields for username and password
>                        add(new 
> TextField<String>("username").setRequired(true));
>                        add(new 
> PasswordTextField("password").setRequired(true));
>
>                        // MarkupContainer row for remember me checkbox
>                        WebMarkupContainer rememberMeRow = new 
> WebMarkupContainer(
>                                        "rememberMeRow");
>                        add(rememberMeRow);
>
>                        // Add rememberMe checkbox
>                        rememberMeRow.add(new CheckBox("rememberMe"));
>
>                        // Show remember me checkbox?
>                        rememberMeRow.setVisible(includeRememberMe);
>
>                        *//New User button*
>
>                        *Button registerButton= new Button("register" )
>                        {
>                                public void onSubmit()
>                                {
>
>                                        
> setResponsePage(AddNewCustomerPage.class);
>                                        System.out.println("New user button 
> was pressed");
>                                }
>                        };
>                        registerButton.setDefaultFormProcessing(false);
>                        add(registerButton);*
>                }
>
>                /**
>                 * @see org.apache.wicket.markup.html.form.Form#onSubmit()
>                 */
>                @Override
>                public final void onSubmit() {
>                        IAuthenticationStrategy strategy = getApplication()
>                                        
> .getSecuritySettings().getAuthenticationStrategy();
>
>                        if (signIn(getUsername(), getPassword())) {
>                                //onSignInSucceeded();
>                                User user = ((CallToFixWebSession) 
> getSession()).getUser();
>                                onSignInSucceededWithRedirect(user);
>
>                                if (rememberMe == true) {
>                                        strategy.save(username, password);
>                                } else {
>                                        strategy.remove();
>                                }
>                        } else {
>                                onSignInFailed();
>                                strategy.remove();
>                        }
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/setResponsePage-is-not-working-in-SignInPanel-tp3823554p3823554.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Reply via email to