Ah.. ok. It [StringResourceModel] just feels so much like a waste I
have forgotten about it ;) Tnx.

**
Martin

2009/7/25 Per Newgro <per.new...@gmx.ch>:
> Martin Makundi schrieb:
>>
>> Or what is the best-practice to avoid these warnings: "Make sure you
>> are not calling Component#getString() inside your Component's
>> constructor."
>>
>
> I would use a StringResourceModel. Then the value for getString will be used
> in rendering not at
> construction time.
>
> XYZComponent extends xxx  {
>
>   public XYZComponent(String id) {
>       add(new Label("idxyz", new StringResourceModel("localized_label"));
>      //Sometimes like this, sometimes just using <wicket:message key="xyz"/>
>   }
> }
>
> Cheers
> Per
>
>
> ---------------------------------------------------------------------
> 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

Reply via email to