Re: "wicket:message" in markup combined with Property Expression Language
Guten Tag Bas Gooren, am Freitag, 14. August 2020 um 14:59 schrieben Sie: > In both classes I see that wicket uses the provided message key verbatim, > without doing any property replacement prior to using it to find a > localized message. > This means you’ll have to wire things up in java code to make your use-case > work. Thanks for looking into this. As I only needed two cases currently, I decided to rollback to my former implementation of subclassing my panel into two and create instances of those subclasses. This allows to have individual language files per subclass again and seems easier than to work with components not used otherwise. Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: "wicket:message" in markup combined with Property Expression Language
Hi Thorsten, I had a quick look at the source code for this: For wicket:message attributes, wicket uses WicketMessageTagHandler; For wicket:message tags it uses WicketMessageResolver. In both classes I see that wicket uses the provided message key verbatim, without doing any property replacement prior to using it to find a localized message. This means you’ll have to wire things up in java code to make your use-case work. Met vriendelijke groet, Kind regards, Bas Gooren Op 14 augustus 2020 bij 09:56:50, Thorsten Schöning (tschoen...@am-soft.de) schreef: Hi all, I know how to use StringResourceModel with Property Expression Language to read keys and values from language files using some dynamic parts. The point is that StringResourceModel needs to be provided to some component, like a label, or that model needs to be used manually to read some values. But is the same available when Wicket does things automatically, like handling localized messages? > title="Show details of all [...] meters." > wicket:message="title:caption.${kindOfDetail}.show.title"> > > Details of all [...] meters. > That link is part of some markup of some component, but is not used by the component itself, only by some client-side JavaScript. Though, I would like to make the "caption"-text be resolved by some dynamic key provided by the component. Is that posisble and if so, how do I need to provide that key? Do I need to set a StringResourceModel with that key as default model of that component? Thanks! Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
"wicket:message" in markup combined with Property Expression Language
Hi all, I know how to use StringResourceModel with Property Expression Language to read keys and values from language files using some dynamic parts. The point is that StringResourceModel needs to be provided to some component, like a label, or that model needs to be used manually to read some values. But is the same available when Wicket does things automatically, like handling localized messages? > title="Show details of all [...] meters." > wicket:message="title:caption.${kindOfDetail}.show.title"> > > Details of all [...] meters. > That link is part of some markup of some component, but is not used by the component itself, only by some client-side JavaScript. Though, I would like to make the "caption"-text be resolved by some dynamic key provided by the component. Is that posisble and if so, how do I need to provide that key? Do I need to set a StringResourceModel with that key as default model of that component? Thanks! Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org