[
https://issues.apache.org/jira/browse/WICKET-1486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586479#action_12586479
]
Juergen Donnerstag commented on WICKET-1486:
--------------------------------------------
I didn't like the idea of makeing renderNext() protected and figured out a
different way to implement the functionality. I'm rendering the tags into a
StringResponse and use MapVariableInterpolator to replace the variables. It'll
not only try the child tags but via PropertyResolver it'll test the container
Model and the container itself to resolve the variables. And by rendering into
a StringResponse we got rid of the restriction to be allowed to use a variable
just once. You can now it as often as you want to.
The changed functionality will probably go into 1.4
> Allow child components inside of wicket:message
> -----------------------------------------------
>
> Key: WICKET-1486
> URL: https://issues.apache.org/jira/browse/WICKET-1486
> Project: Wicket
> Issue Type: New Feature
> Components: wicket
> Affects Versions: 1.3.2
> Reporter: John Ray
> Assignee: Juergen Donnerstag
> Fix For: 1.4-M1
>
> Attachments: Message.diff, MessageQuickStart.zip
>
>
> Currently you can't put a link or text in the middle of a wicket:message. You
> need to break up the message into 2 parts as text before the link and text
> after the link.
> I've made a modification to the WicketMessageResolver class that allows you
> to nest child components inside a wicket:message and then reference them from
> the properties file. For example in the html
> <wicket:message key="myKey">
> This text will be replaced with text from the properties file.
> <span wicket:id="amount">[amount]</span>.
> <a wicket:id="link">
> <wicket:message key="linkText"/>
> </a>
> </wicket:message>
>
> Then in the properties file have a variable with a name that matches the
> wicket:id for each child component. The variables can be in any order, they
> do NOT have to match the order in the HTML file.
> myKey=Your balance is ${amount}. Click ${link} to view the details.
> linkText=here
>
> And in the java
> add(new Label("amount",new Model("$5.00")));
> add(new BookmarkablePageLink("link",DetailsPage.class));
>
> In the browser this will output
> Your balance is $5.00. Click -here- to view the details.
> I'll attach a quick start as well as an svn diff.
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.