Exactly as James suggest and what I said earlier: use something like this, add( new Label( "page.label", new ResourceModel( "page.label" ) ); Instead of 'page.label' do something like error.label.key#
where key# is what you get from the service. On Mon, Jun 2, 2008 at 3:05 PM, James Carman <[EMAIL PROTECTED]> wrote: > On Mon, Jun 2, 2008 at 8:01 AM, wenm <[EMAIL PROTECTED]> wrote: > > > > Sure. > > > > Maybe I need to explain more explicitly. > > > > I will get the unique error code from web service if there is something > > wrong. And then I would like to map the error codes to user-friendly > > messages (which are in properties file), and show the messages > conditionally > > based on the error type in a label. > > > > For example > > if(error code == 1){ > > add(new Label("a", property.getProperty(key1))); > > } else if (error code ==2){ > > ............. > > } > > > > So the first thing is that I have to read the properties file and let the > > property to load it, so I can get the value(the message which I want to > > show). > > Have you looked at org.apache.wicket.model.ResourceModel? You could do: > > new Label("a", new ResourceModel(key1)) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74