oliverw skrev:
Oh an by the way. The constructor for my summary page looks like this at the
moment:
public RegistrationResultPage(final int user_id)
{
super(null);
// model setup
IModel model = new CompoundPropertyModel(new LoadableDetachableModel()
{
public Object load()
{
return userAccountService.getUser(user_id);
}
});
setModel(model);
add(new Label("info", new PropertyModel(getModel(), "email")));
}
What's the recommended way to format the output for label "info" before it
get's rendered. For example. The property getter for the "email" property
returns [EMAIL PROTECTED] but I would like to apply a format string like "%s
foo bar" to the value resulting in "[EMAIL PROTECTED] foo bar" as the label
text.
You could do:
add(new Label("info", new Model() {
public Object getObject() {
return ((User)getModelObject()).getEmail() + " foo bar";
}
});
Also, depending on your need, you could pass in the User in the page
constructor instead of the user_id, and setModel(user) directly.
-- Edvin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]