I had a similar problem with JavaScript inside a <script> tag. Basicly all
the JavaScript was static only the id one value (the id of a tag) had to
be replaced. I tried to do that with a label but this did not render. So I
ended up to put all the JavaScript in a (Java) String.
Could the RawMarkup Element parse its (raw) String for contained (ie ognl)
expressions and than during render evaluates these expressions against the
rendering component. I know this is not realy the wicket way, but may be
it could sometimes help.
Christian
On Wed, 9 Nov 2005 09:28:55 +0100, Juergen Donnerstag
<[EMAIL PROTECTED]> wrote:
I'm all for making things easier for the user.
Perhaps Wicket could have something like this:
<span wicket:id="message:myLabelHere"></span>
I'm not sure this makes sense. wicket:id is not a text to be displayed
anywhere. It is a name which identifies a component. It definitely
won't work.
Even better would be that it would recognize the message:label anywhere
in
the HTML. So for example, you could have:
<input type="submit" value="message:label.submit" />
That I think is possible. Acutally you can do it today already without
any changes to the core. You need to develop a IMarkupFilter and
append it to the list of existing ones invoked by MarkupFilter.
However you won't be able to handle "message: ...." within a tag body;
only tag attributes. How does Tapestry do it for body text?
An other option would be to run a kind of text based (not xml based)
pre-processor (like we do merging of inherited markup) prior to adding
the markup to the cache.
How likely is it that you'll find "message:" and it is not intended to
be a i18n text? How to escape it?
Lets say your message must contain a reference some other data, e.g.
"...${price}...". That won't be possible either. Only simple text. As
AttributeModifier is already able to handle it, "message:.." would be
for easy and straight forward replacements only, and AttributeModifer
to cover everything else.
Ah, and of course you loose preview capabilities, as the designer
won't the real message, he'd see "message:..." only.
And it might not the perfekt solution for high-speed up, because of
the (little) performance penalties involved. For high-speed up you can
still have myPage_en.html; myPage_nl.html etc may which as well cover
minor changes in the layout due to labels being of differents length;
right-to-left languages etc.
Juergen
On 11/8/05, Andrew Berman <[EMAIL PROTECTED]> wrote:
In my app I never hard-code text so I'm constantly adding Labels to my
pages. I was wondering if it would make sense to have a shortcut,
similar
to how Tapestry does it, for dsplaying localization messages. In
Tapestry,
you can do this: title="message:page-title", where page-title is the
lookup
into the property file.
Perhaps Wicket could have something like this:
<span wicket:id="message:myLabelHere"></span>
Even better would be that it would recognize the message:label anywhere
in
the HTML. So for example, you could have:
<input type="submit" value="message:label.submit" />
Thoughts?
--Andrew
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
--
Christian Essl
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user