Try just adding the label with a regular PropertyModel, not a custom one.  Then 
override getConverter on Label to do the conversion from Locale to String (and 
back if it weren't a read-only label you needed it for).

Hope this helps - I'm not on my computer, or I'd give you a better example.

Jeremy Thomerson
-- sent from a wireless device

-----Original Message-----
From: "Pieter Cogghe" <[EMAIL PROTECTED]>
To: wicket-user@lists.sourceforge.net
Sent: 6/14/07 3:01 AM
Subject: [Wicket-user] Label - alter rendering

I've got a model with a language (Locale) property. I want to write
the language (language.getDisplayLanguage) in a Label. I did it like
this:

item.add(new Label("language", new PropertyModel(item.getModel(),"language")){
   @Override
     protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
       Locale model = (Locale) getModelObject();
       replaceComponentTagBody(markupStream, openTag,
model.getDisplayLanguage());
       }
     });

This doesn't feel right. Anybody a better idea? (Maybe override the
toString method of Locale?)

thanks,

Pieter

-- 
Pieter Cogghe
Ganzendries 186
9000 Gent
0487 10 14 21

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to