[ 
https://issues.apache.org/jira/browse/WICKET-4007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094506#comment-13094506
 ] 

Bruno Borges commented on WICKET-4007:
--------------------------------------

Current Wicket simplicity is not being broken by this feature.
And in fact, there are lots of other things that you can do in several ways in 
Wicket. 
For example: <wicket:container> against <div wicket:id="container"> ++ 
container.setRenderBodyOnly(true);
Wicket presents many features that can be used to do the same thing.

The whole point of this feature is to be able to easily add references to a 
model content in the markup, without having to modify the Java class.

Dynamic values such as person's names, addresses, IDs, dates and so on, can be 
referenced in the markup, in different places, without having to manually add 
labels (repeating the same line of code or looping around and giving different 
ids) in the Java code.

> 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

        

Reply via email to