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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

pasto
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>Loading...</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.
Reply | Threaded
Open this post in threaded view
|

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

Igor Vaynberg-2
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]

Reply | Threaded
Open this post in threaded view
|

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

pasto
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]
<[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

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

Igor Vaynberg-2
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 <[hidden email]> 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]
> <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]