Hasn't anybody else been in this situation ? I finally checked it is
necessary for a regular tag with a wicket:message attribute and with wicket
component childs to be also a wicket component... Maybe it would be nice to
have this information on the wiki page talking about the wicket:message
attribute...

This example would give the error:

public class TestPage extends Page {
public TestPage(){
add(new Label("childLabel", "Sample text for the label"));
}
}

<html>
<body>
<table wicket:message="summary:anyResourceKey">
<tr><td><span wicket:id="childLabel"></span></td></tr>
</table>
</body>
</html>


The only way I see to get around it is to :
public class TestPage extends Page {
public TestPage(){
WebMarkupContainer cont = new WebMarkupContainer("cont");
add(cont);
cont.add(new Label("childLabel", "Sample text for the label"));
}
}

<html>
<body>
<table wicket:id="cont" wicket:message="summary:anyResourceKey">
<tr><td><span wicket:id="childLabel"></span></td></tr>
</table>
</body>
</html>

Cheers,
Xavier

2010/4/29 Xavier López <[email protected]>

> Yes, you are right, Wilhelmsen, and that's what Wicket is doing, I
> understand that correctly. The problem is, when I have a wicket component
> attached to that <table> tag. Wicket seems to treat that <table> as a
> component, with autogenerated wicket:id, and logically, expects the child
> components (in markup) to be added to it. I suppose I have to manually model
> that <table> into a wicket component (i.e. WebMarkupContainer) in order to
> be able to add those child components to it and let Wicket process the
> component hierarchy correctly...
>
>
> BTW, I just noticed I wrote the last message incorrectly:
>
> <input type="text" wicket:message="title:myresource"></input>
>
> Turns into
>
> <input type="text" title="Test Title"></input>
>
>
> Thanks,
> Xavier
>
> 2010/4/29 Wilhelmsen Tor Iver <[email protected]>
>
> > i meant where do you expect the localized message to be rendered into?
>> > if wicket:message is attached to the table tag?
>>
>> Well, since he is using the attribute version of wicket:message, I guess
>> he expects the output from
>>
>> > >> <table wicket:message="summary:myresource">
>>
>> to be
>>
>> <table summary="localized message with key myresource">
>>
>> - Tor Iver
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>

Reply via email to