You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pasto <pe...@gmail.com> on 2011/06/19 15:42:09 UTC

Replacement of a markup container with nested components by a panel / fragment

Hi,

I guess, this is the same question as the 'WICKET-1190' issue.

Extending AjaxLazyLoadPanel and overriding the xhtml markup file and the
getLoadingComponent method causes, as soon as there is a child component in
the 'content' component, "Close tag not found for tag" exception.

<wicket:panel xmlns:wicket =
"http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
	<wicket:container wicket:id="content">
		<center> /static/img/small-ajax-loader.gif </center>
	</wicket:container>
</wicket:panel>

The reason is a check in the
'AbstractMarkupSourcingStrategy.onComponentTagBody' method:

if (markupStream.getPreviousTag().isOpen())
{
	markupStream.skipRawMarkup();
	if (markupStream.get().closes(openTag) == false)
	{
		throw new MarkupException(markupStream, "Close tag not found for tag: " +
			openTag.toString() + ". Component: " + component.toString());
	}
}

Changing it to:

if (markupStream.getPreviousTag().isOpen())
{
	markupStream.skipToMatchingCloseTag(markupStream.getPreviousTag());
}

seems to work fine.

Is there a reason to not allow replacement of a markup container with nested
components by a panel / fragment? I think, that the definition of
alternative panels (e.g. lazy load panels) would be easier.

Just being curious...

Peter.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3609276.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Replacement of a markup container with nested components by a panel / fragment

Posted by Igor Vaynberg <ig...@gmail.com>.
wicket traverses the hierarchy and renders all the tags. if you have a
tag with wicket:id in markup you must have it in java.

-igor

On Mon, Jun 20, 2011 at 8:10 AM, pasto <pe...@gmail.com> wrote:
> Thank you, for your replay. I understand your point, but is it really
> necessary to have it rendered? What I was doing, was a component
> replace. I just had the feeling, that the important part, is to have a
> strict binding between components and markup files and not to restrict
> the developer to manipulate which component is displayed where. But I
> might be wrong, of course... it might be more important, f.e. to know,
> that there is some markup, that hasn't been rendered...
>
> Peter.
>
>
> On Mon, Jun 20, 2011 at 4:29 PM, Igor Vaynberg-2 [via Apache Wicket]
> <ml...@n4.nabble.com> wrote:
>> if you have
>> <div wicket:id="foo"><a wicket:id="bar"/></div>
>> and you attach a panel to "foo" who is going to render "bar"?
>>
>> -igor
>>
>>
>> On Sun, Jun 19, 2011 at 6:42 AM, pasto <[hidden email]> wrote:
>>> Hi,
>>>
>>> I guess, this is the same question as the 'WICKET-1190' issue.
>>>
>>> Extending AjaxLazyLoadPanel and overriding the xhtml markup file and the
>>> getLoadingComponent method causes, as soon as there is a child component
>>> in
>>> the 'content' component, "Close tag not found for tag" exception.
>>>
>>> <wicket:panel xmlns:wicket =
>>> "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
>>>        <wicket:container wicket:id="content">
>>>                <center> /static/img/small-ajax-loader.gif </center>
>>>        </wicket:container>
>>> </wicket:panel>
>>>
>>> The reason is a check in the
>>> 'AbstractMarkupSourcingStrategy.onComponentTagBody' method:
>>>
>>> if (markupStream.getPreviousTag().isOpen())
>>> {
>>>        markupStream.skipRawMarkup();
>>>        if (markupStream.get().closes(openTag) == false)
>>>        {
>>>                throw new MarkupException(markupStream, "Close tag not
>>> found for tag: " +
>>>                        openTag.toString() + ". Component: " +
>>> component.toString());
>>>        }
>>> }
>>>
>>> Changing it to:
>>>
>>> if (markupStream.getPreviousTag().isOpen())
>>> {
>>>        markupStream.skipToMatchingCloseTag(markupStream.getPreviousTag());
>>> }
>>>
>>> seems to work fine.
>>>
>>> Is there a reason to not allow replacement of a markup container with
>>> nested
>>> components by a panel / fragment? I think, that the definition of
>>> alternative panels (e.g. lazy load panels) would be easier.
>>>
>>> Just being curious...
>>>
>>> Peter.
>>>
>>> --
>>> View this message in context:
>>> http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3609276.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3611541.html
>> To unsubscribe from Replacement of a markup container with nested components
>> by a panel / fragment, click here.
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3611639.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Replacement of a markup container with nested components by a panel / fragment

Posted by pasto <pe...@gmail.com>.
Thank you, for your replay. I understand your point, but is it really
necessary to have it rendered? What I was doing, was a component
replace. I just had the feeling, that the important part, is to have a
strict binding between components and markup files and not to restrict
the developer to manipulate which component is displayed where. But I
might be wrong, of course... it might be more important, f.e. to know,
that there is some markup, that hasn't been rendered...

Peter.


On Mon, Jun 20, 2011 at 4:29 PM, Igor Vaynberg-2 [via Apache Wicket]
<ml...@n4.nabble.com> wrote:
> if you have
> <div wicket:id="foo"><a wicket:id="bar"/></div>
> and you attach a panel to "foo" who is going to render "bar"?
>
> -igor
>
>
> On Sun, Jun 19, 2011 at 6:42 AM, pasto <[hidden email]> wrote:
>> Hi,
>>
>> I guess, this is the same question as the 'WICKET-1190' issue.
>>
>> Extending AjaxLazyLoadPanel and overriding the xhtml markup file and the
>> getLoadingComponent method causes, as soon as there is a child component
>> in
>> the 'content' component, "Close tag not found for tag" exception.
>>
>> <wicket:panel xmlns:wicket =
>> "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
>>        <wicket:container wicket:id="content">
>>                <center> /static/img/small-ajax-loader.gif </center>
>>        </wicket:container>
>> </wicket:panel>
>>
>> The reason is a check in the
>> 'AbstractMarkupSourcingStrategy.onComponentTagBody' method:
>>
>> if (markupStream.getPreviousTag().isOpen())
>> {
>>        markupStream.skipRawMarkup();
>>        if (markupStream.get().closes(openTag) == false)
>>        {
>>                throw new MarkupException(markupStream, "Close tag not
>> found for tag: " +
>>                        openTag.toString() + ". Component: " +
>> component.toString());
>>        }
>> }
>>
>> Changing it to:
>>
>> if (markupStream.getPreviousTag().isOpen())
>> {
>>        markupStream.skipToMatchingCloseTag(markupStream.getPreviousTag());
>> }
>>
>> seems to work fine.
>>
>> Is there a reason to not allow replacement of a markup container with
>> nested
>> components by a panel / fragment? I think, that the definition of
>> alternative panels (e.g. lazy load panels) would be easier.
>>
>> Just being curious...
>>
>> Peter.
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3609276.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3611541.html
> To unsubscribe from Replacement of a markup container with nested components
> by a panel / fragment, click here.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3611639.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Replacement of a markup container with nested components by a panel / fragment

Posted by Igor Vaynberg <ig...@gmail.com>.
if you have
<div wicket:id="foo"><a wicket:id="bar"/></div>
and you attach a panel to "foo" who is going to render "bar"?

-igor


On Sun, Jun 19, 2011 at 6:42 AM, pasto <pe...@gmail.com> wrote:
> Hi,
>
> I guess, this is the same question as the 'WICKET-1190' issue.
>
> Extending AjaxLazyLoadPanel and overriding the xhtml markup file and the
> getLoadingComponent method causes, as soon as there is a child component in
> the 'content' component, "Close tag not found for tag" exception.
>
> <wicket:panel xmlns:wicket =
> "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
>        <wicket:container wicket:id="content">
>                <center> /static/img/small-ajax-loader.gif </center>
>        </wicket:container>
> </wicket:panel>
>
> The reason is a check in the
> 'AbstractMarkupSourcingStrategy.onComponentTagBody' method:
>
> if (markupStream.getPreviousTag().isOpen())
> {
>        markupStream.skipRawMarkup();
>        if (markupStream.get().closes(openTag) == false)
>        {
>                throw new MarkupException(markupStream, "Close tag not found for tag: " +
>                        openTag.toString() + ". Component: " + component.toString());
>        }
> }
>
> Changing it to:
>
> if (markupStream.getPreviousTag().isOpen())
> {
>        markupStream.skipToMatchingCloseTag(markupStream.getPreviousTag());
> }
>
> seems to work fine.
>
> Is there a reason to not allow replacement of a markup container with nested
> components by a panel / fragment? I think, that the definition of
> alternative panels (e.g. lazy load panels) would be easier.
>
> Just being curious...
>
> Peter.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Replacement-of-a-markup-container-with-nested-components-by-a-panel-fragment-tp3609276p3609276.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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