Seems Juergen did not implement this yet. I mentioned this in our discussion
and he did not object so assumed this was implemented.
The code at fault is here:
AbstractValidator:
protected Map messageModel(final FormComponent formComponent)
{
final Map resourceModel = new HashMap(4);
resourceModel.put("input", formComponent.getInput());
resourceModel.put("name", formComponent.getId());
if (formComponent.getLabel() != null)
{
resourceModel.put("label",
formComponent.getLabel().getObject(null));
}
else
{
resourceModel.put("label", formComponent.getId());
}
return resourceModel;
}
It should be:
protected Map messageModel(final FormComponent formComponent)
{
final Map resourceModel = new HashMap(4);
resourceModel.put("input", formComponent.getInput());
resourceModel.put("name", formComponent.getId());
if (formComponent.getLabel() != null)
{
resourceModel.put("label",
formComponent.getLabel().getObject(null));
}
else {
final String
labelKey=formComponent.getForm().getId()+"."+formComponent.getId();
try {
String
label=formComponent.getLocalizer().getString(labelKey, formComponent);
resourceModel.put("label", label);
} catch (MissingResourceException e) {
resourceModel.put("label",
formComponent.getId());
}
}
return resourceModel;
}
Not sure what the best way to create the labelkey is, but the above is
consistent with how it was created before the change.
One little caveat of the above is that if wicket is configured not to throw
an exception on a missing resource the label variable will be populated with
a "[...warning resource not found...]" string since that's what the
localizer will return. Not sure how to recover from it since it would be
nice to have the formcomponent.getid() be the default label if all else
fails like its doing right now.
Thoughts?
-Igor
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Phil Kulak
> Sent: Monday, October 17, 2005 2:02 PM
> To: wicket-develop
> Subject: [Wicket-develop] FormComponent label values are not
> getting picked up...
>
> ... from the property file. No matter what I do, $label is
> always the id of the component. Anyone else notice this?
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads,
> discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop