HiI just disovered by chance that it's possible to use property expressions in normal <wicket:message key="..."/> elements which then get resolved against the next model found in the hierarchy. Unfortunately it seems to work a bit different to other automatic resolving like in new Label("property").
Example:I've got a page with a WebMarkupContainer containing both a normal (wicket) label and a <wicket:message> in the HTML.
The page model's object has a method say String getSomething()
Java:
WebMarkupContainer c = new WebMarkupContainer("container");
add(c);
c.add(new Label("something"));
HTML:
<div wicket:id="container">
<span wicket:id="something"/>
<wicket:message key="myKey"/>
</div>
Properties:
myKey = Here it is: ${something}
The Label works as expected and displays the return value of the
getSomething() call.
The message fails with a big exception since it tries to get the model
from the WebMarkupContainer and complains, that there's no
getContainer() method...
Shouldn't this work the same way as with labels, by 'finding' the nex
model available?
The quick solution is to give the WebMarkupContainer also the default
model of the page which works but is not very nice...?
Is this a bug? Then I'll file a JIRA Thanks Matt
smime.p7s
Description: S/MIME Cryptographic Signature
