Re: How to provide a value to a message's argument

2010-03-24 Thread Igor Vaynberg
see StringResourceModel

-igor

On Wed, Mar 24, 2010 at 8:42 PM, David Chang david_q_zh...@yahoo.com wrote:

 HTML:

 span wicket:id=x[sample text]/span

 Java:

 add(new Label(x, new ResourceModel(x)));

 Resource file:

 entry key=xHello ${label} !/entry

 In the above Java, I cannot find a way to provide a value to the argument of 
 the string. I want the program to display

 Hello David!
 Hello Carmen!

 Regards.




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to provide a value to a message's argument

2010-03-24 Thread David Chang
Igor, thanks for the info. It worked for me. Just a suggestion. Hope to see a 
convenience constructor such as:

StringResourceModel(resourceKey, java.lang.Object[] parameters)

In which, model is null. IMHO, Spring has many convenience methods. It would be 
good to see Wicket does the same (maybe already does it, but I dont know about).

Regards.

--- On Wed, 3/24/10, Igor Vaynberg igor.vaynb...@gmail.com wrote:

 From: Igor Vaynberg igor.vaynb...@gmail.com
 Subject: Re: How to provide a value to a message's argument
 To: users@wicket.apache.org
 Date: Wednesday, March 24, 2010, 11:49 PM
 see StringResourceModel
 
 -igor
 
 On Wed, Mar 24, 2010 at 8:42 PM, David Chang david_q_zh...@yahoo.com
 wrote:
 
  HTML:
 
  span wicket:id=x[sample text]/span
 
  Java:
 
  add(new Label(x, new ResourceModel(x)));
 
  Resource file:
 
  entry key=xHello ${label} !/entry
 
  In the above Java, I cannot find a way to provide a
 value to the argument of the string. I want the program to
 display
 
  Hello David!
  Hello Carmen!
 
  Regards.
 
 
 
 
 
 -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org