[
https://issues.apache.org/jira/browse/WICKET-4007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094162#comment-13094162
]
bernard commented on WICKET-4007:
---------------------------------
Because you are asking for comments.
As a Wicket user, it looks to me like a departure from Wicket concepts such as
components and models and I would not want to ever see this in Wicket.
It tastes like Spaghetti. It looks like Struts. What about a wicket:loop,
wicket:if, wicket:else ? It basically starts putting logic into the markup
through the back door and degrades the page object to something even less
expressive than a Struts backing bean. In wicket page markup, wicket tags refer
to some component not values. Even with CompoundPropertyModel, which through
its property expression syntax reveals the link to properties in the markup,
the wicket IDs refer to components not values.
> New tag wicket:var
> ------------------
>
> Key: WICKET-4007
> URL: https://issues.apache.org/jira/browse/WICKET-4007
> Project: Wicket
> Issue Type: New Feature
> Components: wicket
> Reporter: Bruno Borges
> Labels: tag,, variable, wicket,
> Attachments: wicket-var-feature.diff
>
>
> This will facilitate users to reference models in several places of the
> markup.
> One can do:
> class Page extends WebPage {
> public Page() {
> putVariable("username", "Peter Johnson");
> }
> }
> <html>
> <body>
> <div class="header">
> <wicket:var name="name" />
> </div>
> <div class="container">
> <wicket:var name="name" />
> </div>
> <div class="footer">
> <wicket:var name="name" />
> </div>
> </body>
> </html>
> It will be possible too to do such a thing:
> Java: putVariable("css", "blue-header");
> HTML: <div wicket:var="class:css">
> And render: <div class="blue-header">
> These variables can be rendered multiple times and my also be accessed from
> child objects (but not the opposite), like:
> add(new WebMarkupContainer("header"));
> <div wicket:id="header">
> <span wicket:var="class:css">Header</span>
> </div>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira