You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dirk Forchel <di...@exedio.com> on 2018/06/01 07:48:17 UTC

Accessing the Markup of a Component

We have a problem accessing the markup (Component#getMarkup()) of a Panel
while inizializing the panel component. Is it ensured, that
Component#getMarkup() always returns an appropriate markup (markup tag)
during initializion?
As soon as we have a Border component, a TransparentWebMarkupContainer and a
corresponding panel in our component hierarchy, we will not have access to
the markup during initialization. Instead, the value returned is null.

There are no problems during the render phase.

Here's a quickstart which shows the problem with a dummy test panel.
quickstart.zip
<http://apache-wicket.1842946.n4.nabble.com/file/t136744/quickstart.zip>  

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Accessing the Markup of a Component

Posted by Dirk Forchel <di...@exedio.com>.
Hallo Sven,
thank your for your answer and for your comprehensive explanation. So we
should be careful not to use these components together unless supported.
Thanks.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Accessing the Markup of a Component

Posted by Sven Meier <sv...@meiers.net>.
Hi,

there's a difference how borders load markup for their children.

Without any border involved (TestPage1), 
MarkupContainer#getMarkup(child) asks a DefaultMarkupSourcingStrategy to 
resolve the markup, which does some magic to support 
TransparentWebMarkupContainers.

Border#getMarkup(child) on the other hand (TestPage2) just uses the 
fragment of its border to search for that markup.

So it seems your combined usage of TransparentWebMarkupContainers inside 
a border and  is not supported at the moment.

Have fun
Sven


Am 01.06.2018 um 09:48 schrieb Dirk Forchel:
> We have a problem accessing the markup (Component#getMarkup()) of a Panel
> while inizializing the panel component. Is it ensured, that
> Component#getMarkup() always returns an appropriate markup (markup tag)
> during initializion?
> As soon as we have a Border component, a TransparentWebMarkupContainer and a
> corresponding panel in our component hierarchy, we will not have access to
> the markup during initialization. Instead, the value returned is null.
>
> There are no problems during the render phase.
>
> Here's a quickstart which shows the problem with a dummy test panel.
> quickstart.zip
> <http://apache-wicket.1842946.n4.nabble.com/file/t136744/quickstart.zip>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org