I don't know if these are actually SignInPanel (from wicket-auth-roles)
questions or if they're in fact more general "wicket" questions; probably
the latter, but the SignInPanel class is where I noticed these things.

1) In the SignInPanel I notice that instead of having a couple of private
String variables to represent the username and password, a ValueMap is used
instead. I'm curious as to why.  Is there some benefit to using a ValueMap? 

2) When the values that are typed in the username and password fields are
needed to pass to the signIn() method, they are retrieved in ways that I
would not have normally considered. The username value is retrieved with the
getDefaultModelObjectAsString() method of the username's TextField component
and the password is retrieved with the getInput() method of the password's
PasswordTextField component. Why are the values retrieved this way? I assume
there's a good reason, but because I don't understand it, I'm a bit unsure
as to where in my own application I should be using the same techniques.

My first instinct for a panel like this would have been to add two String
variables to the class to act as the model for the username and password
TextFields and then to access those values with normal getter methods. I'd
would find it quite instructive to know why these other approaches were used
instead so that I can take similar actions in my own application.

Thanks!

I'll include some snippets from the SignInPanel class below so that it
doesn't have to be looked up:


-------------
        private final ValueMap properties = new ValueMap();
-------------
        add(username = new TextField<String>("username", new
PropertyModel<String>(properties,
                                "username")));
        add(password = new PasswordTextField("password", new
PropertyModel<String>(properties,
                                "password")));
-------------
        public String getPassword()
        {
                return password.getInput();
        }
-------------
        public String getUsername()
        {
                return username.getDefaultModelObjectAsString();
        }
-------------



-- 
View this message in context: 
http://www.nabble.com/Some-SignInPanel-Questions-tp22094376p22094376.html
Sent from the Wicket - User 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

Reply via email to