Actually the example does set a model for the password field. As shown
in this snippet.

//Set compound model on the form, inputfields will use that model too.
super(id, new CompoundPropertyModel(new ValueMap()));
// only remember username, not passwords
add(new 
TextField("username").setPersistent(rememberMe).setOutputMarkupId(false));
add(new PasswordTextField("password").setOutputMarkupId(false));
add(new CheckBox("rememberMe", new PropertyModel(this, "rememberMe")));

I added an extra comment to show this more clearly :).

As for the message you are receiving when running from glasshfish, i
don't know why you are getting that, i don't remember seeing it when
running from tomcat. but as stated you could try
 add(new 
PasswordTextField("password").setType(String.class).setOutputMarkupId(false));

Maurice

On Fri, Jun 13, 2008 at 2:07 AM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> no, you dont typically initialize the field. but you do want to
> retrieve the result right? so you need to give the field a model.
> wicket might not call model.getobject() on it, but it will call
> model.setobject() when the form is submitted.
>
> models do not contain data for markup, but for components.
>
> -igor
>
> On Thu, Jun 12, 2008 at 3:04 PM, David Nedrow <[EMAIL PROTECTED]> wrote:
>> Given the following from the wicket security quickstart (1.3-SNAPSHOT)...
>>
>> add(new PasswordTextField("password").setOutputMarkupId(false));
>>
>> glassfish generates the following message....
>>
>> Couldn't resolve model type of
>> Model:classname=[org.apache.wicket.model.CompoundPropertyModel$AttachedCompoundPropertyModel]:nestedModel=[Model:classname=[org.apache.wicket.model.CompoundPropertyModel]:nestedModel=[username
>> = "regular"]] for [MarkupContainer [Component id = password, page =
>> com.vzbi.ncs.argfrp.webapp.FilterRequest.app.LoginPage, path =
>> 0:signInPanel:signInForm:password.PasswordTextField, isVisible = true,
>> isVersioned = false]], please set the type yourself.
>>
>> Not setting the model does not seem to create a problem, but it would seem
>> that the system would prefer that models be set where applicable.
>>
>> Is that the case? I have to admit, I'm a little anal about clearing all
>> warnings in my apps.
>>
>> What would an appropriate model be for the above PasswordTextField()?
>>
>> Models seem to be the most poorly "exampled" Wicket feature, in that
>> examples of Models rarely tell one why they are needed and what role they
>> perform. It's generally, here's an example to make your code work. Clearly,
>> in most cases the model contains the data for the markup. But what would
>> that data be for a PasswordTextField()? One isn't normally going to pre-fill
>> a password field, correct?
>>
>> Thanks,
>>
>> David
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to