Andrew Berman wrote:
I think the attribute feature should be removed. I think it is just un-Wicket-like, and I think others agree as I read form the emails in this thread. As I mentioned before I think when it comes to attributes, it is best to just do it from within the component manually instead of the way you have it.

I'm still mixed about this. I think the Button use-case is not particularly an issue; how often in a Wicket app do you need buttons that aren't going to be Components? But there is one other place that I've used i18n in webapps that uses an attribute: the "class" attribute for all sorts of elements. Sometimes I've used entirely different CSS files for different locales, but other times I simply switch classes. However this was in JSP or PHP applications, where adding

    <p class="warning <?php echo($locale_class);?>">...

to match

    p.warning.en {background-color: red;}
    p.warning.fr {background-color: yellow;}
    ...

doesn't add any additional code smell to what's already a hodgepodge of business logic and presentation. In Wicket, it doesn't smell quite right. So even though I have a use-case where it might help, I think this could get ugly.

The example above demonstrates still another syntax issue I would love resolved if Wicket were to implement the attribute bit, and I find that I really don't like the added complexity of any solution I can suggest. The issue is that I would love the output to be

    <p class="warning en">...

but I want only the "en" to be dynamic.  Sure we could do

    <p class="warning" wicket:message="class+=localeClass">...

(note the "+="). But then do we add the separating space in the HTML like this:

    <p class="warning " wicket:message="class+=localeClass">...

or in the i18n itself, or in the Wicket markup like this:

    <p class="warning" wicket:message="class+= localeClass">...

(note the space after "+=")? Only the last possibility seems to be flexible enough for this use, and it's rather too subtle for my taste.

Note that I'm not suggesting that Wicket actually implement this. I'm trying to point out that, while adding the i18n element is quite clean, adding the attribute might be heading us down a thorny path.

Just the two cents of a Wicket neophyte...

  -- Scott



-------------------------------------------------------
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

Reply via email to