[
https://issues.apache.org/jira/browse/WICKET-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769244#action_12769244
]
Juergen Donnerstag commented on WICKET-2537:
--------------------------------------------
That is because of the transparent "container" in ParentPanel. An invisible
container will not be rendered, neither will any of its children. But all the
components created in ChildPanels constructor, are added to ChildPanel and not
"container".
I think I understand what you try to achieve, but experience from many users
has shown that it is better to implement something like
ParentPanel.addToXXX(myChild) which adds the child to the "container". For 2
reasons: a) it makes it explicit where you add the child and thus your code is
easier to understand and b) most applications grow in complexity and more often
than not you want to add a component next to the "container" and not inside.
How to do that? There is no way and thus latest than, you'll need to add
something like addToXXX.
This is not a bug.
> Problem with wicket:extend / wicket:child and ListView on not visible
> component
> -------------------------------------------------------------------------------
>
> Key: WICKET-2537
> URL: https://issues.apache.org/jira/browse/WICKET-2537
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.3
> Reporter: Ann Baert
> Attachments: ParentChildPanelExample.zip
>
>
> I have two panels: ChildPanel extends from ParentPanel.
> ParentPanel has a WebMarkupContainer with a <wicket:child>.
> ChildPanel has <wicket:extend> and a repeater like listView of Loop.
> When the WebMarkupContainer from ParentPanel is not visible
> (setVisible(false)), I receive an error with as message that I have added
> components in code, but forgot to reference it in markup. He only gives the
> components from the ChildPanel (in the errorMessage), so the label in the
> WebMarkupContainer on ParentPanel is no problem. It is also only a problem
> when it's a repeater, with a label on ChildPanel, there is no problem (when
> repeater and label, also the label is mentioned in the errorMessage)
> I've made a simple example to make it more clear.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.