Discussion:
Accessing the Markup of a Component
Dirk Forchel
2018-06-01 07:48:17 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Sven Meier
2018-06-02 09:02:44 UTC
Permalink
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
Post by 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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org

Loading...