na83
na83

Reputation: 111

Can there be a "span wicket:id" between the wicket:child tag in parent html page?

The example of what I want to do :

Parent HTML:

<wicket:child>    
 .....
 <span wicket:id="xxx"></span>  
</wicket:child>`   
...  

Child HTML:

<wicket:extend>
... child content ...
</wicket:extend>

Supposedly when child page is opened the extend tag will replace all the content between the child tag in parent html, including the <span wicket:id>.

Apparently this won't work, when the child page is open error will occur:
Wicket tags identified by wicket:id are not allowed in between wicket:child> and </wicket:child>

I assume this is because the wicket:span tag got pass into the child extend page and cause this issue? If the span is removed the problem is resolved.

Is there anyway I can keep the span tag in paranet HTML and still make this work?

Upvotes: 0

Views: 681

Answers (1)

martin-g
martin-g

Reputation: 17503

This is not allowed. Wicket components are not allowed inside <wicket:child>...</wicket:child>. See https://github.com/apache/wicket/blob/9e42a9548adb0da540e4e87d491f5824e778537e/wicket-core/src/main/java/org/apache/wicket/markup/MergedMarkup.java#L295

Why do you want to have it there ? What do you want to achieve ?

Upvotes: 1

Related Questions