You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thibault Kruse <ti...@googlemail.com> on 2014/09/16 16:02:39 UTC

MarkupContainer rendering without children

Hi,

is it intentional that if a class directly extends MarkupContainer,
but does not have any children, then its associated markup is not
rendered?

When using

public class FooMarkupContainer extends MarkupContainer implements
IMarkupCacheKeyProvider {
    public FooMarkupContainer(String id) {super(id);}

    @Override public String getCacheKey(MarkupContainer container,
Class<?> containerClass) {return null;}
}

with markup

<div>Foo works!</div>

or anything, nothing appears on the page.

It seems the javadoc of MarkupContainer is not entirely clear on this:
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/MarkupContainer.html

"Markup Rendering - A MarkupContainer also holds/references associated
markup which is used to render the container. As the markup stream for
a container is rendered, component references in the markup are
resolved by using the container to look up Components in the
container's component map by id. Each component referenced by the
markup stream is given an opportunity to render itself using the
markup stream. "

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


Re: MarkupContainer rendering without children

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

a MarkupContainer does not load additional markup, it just uses the 
markup of its parent.

I'm not sure about the terminology, but IMHO a MarkupContainer does not 
have an 'associated' markup. Just putting an HTML file beside your class 
won't change that.

Sven

On 09/19/2014 01:36 PM, Thibault Kruse wrote:
> bump, any opinion? Should I open a JIRA?
>
> On Tue, Sep 16, 2014 at 4:02 PM, Thibault Kruse
> <ti...@googlemail.com> wrote:
>> Hi,
>>
>> is it intentional that if a class directly extends MarkupContainer,
>> but does not have any children, then its associated markup is not
>> rendered?
>>
>> When using
>>
>> public class FooMarkupContainer extends MarkupContainer implements
>> IMarkupCacheKeyProvider {
>>      public FooMarkupContainer(String id) {super(id);}
>>
>>      @Override public String getCacheKey(MarkupContainer container,
>> Class<?> containerClass) {return null;}
>> }
>>
>> with markup
>>
>> <div>Foo works!</div>
>>
>> or anything, nothing appears on the page.
>>
>> It seems the javadoc of MarkupContainer is not entirely clear on this:
>> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/MarkupContainer.html
>>
>> "Markup Rendering - A MarkupContainer also holds/references associated
>> markup which is used to render the container. As the markup stream for
>> a container is rendered, component references in the markup are
>> resolved by using the container to look up Components in the
>> container's component map by id. Each component referenced by the
>> markup stream is given an opportunity to render itself using the
>> markup stream. "
> ---------------------------------------------------------------------
> 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


Re: MarkupContainer rendering without children

Posted by Thibault Kruse <ti...@googlemail.com>.
bump, any opinion? Should I open a JIRA?

On Tue, Sep 16, 2014 at 4:02 PM, Thibault Kruse
<ti...@googlemail.com> wrote:
> Hi,
>
> is it intentional that if a class directly extends MarkupContainer,
> but does not have any children, then its associated markup is not
> rendered?
>
> When using
>
> public class FooMarkupContainer extends MarkupContainer implements
> IMarkupCacheKeyProvider {
>     public FooMarkupContainer(String id) {super(id);}
>
>     @Override public String getCacheKey(MarkupContainer container,
> Class<?> containerClass) {return null;}
> }
>
> with markup
>
> <div>Foo works!</div>
>
> or anything, nothing appears on the page.
>
> It seems the javadoc of MarkupContainer is not entirely clear on this:
> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/MarkupContainer.html
>
> "Markup Rendering - A MarkupContainer also holds/references associated
> markup which is used to render the container. As the markup stream for
> a container is rendered, component references in the markup are
> resolved by using the container to look up Components in the
> container's component map by id. Each component referenced by the
> markup stream is given an opportunity to render itself using the
> markup stream. "

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