You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ciaran Liedeman <ci...@paltrack.co.za> on 2012/04/03 18:08:46 UTC

Wicket Fragments and Wicket Extends

Hello,

I've been trying to use fragments in a page but can't seem to get it to work.
It fails with an error saying No markup found for fragment id...

I used the example as if from the 1.5 javadocs
http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/html/panel/Fragment.html

the only difference being my page extends a base page. If I remove the wicket:extend in the html
and the extends BasePage in the java the fragment markup is found.

I mananged to get it to work with extending the BasePage by placing the fragment code in the BasePage.html
File but this means all my fragments will have to be placed in that file.

Am I missing something simple? Where should fragment html code be placed for pages that use
wicket:extend?

Ciaran

Paltrack Pty (Ltd) Reg No 2000/002936/07
Directors: A.J. Mouton (Managing) |  J.G.F. du Plessis | J. vW. Rossouw (Chairman)


This email and any accompanying attachments may contain confidential and proprietary information. This information is private
and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire
communication immediately and are notified that any disclosure, copying or distribution of or taking any action based on this
information is prohibited.

Emails cannot be guaranteed to be secure or free of errors or viruses. The sender does not accept any liability or
responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or
interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever
reason or for its effect on any electronic device of the recipient.

If verification of this email or any attachment is required, please request a hard copy version.
______________________________________
Queries to: helpdesk@paltrack.co.za

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


RE: Wicket Fragments and Wicket Extends

Posted by Ciaran Liedeman <ci...@paltrack.co.za>.
Hello

I've attached a quickstart that reproduces my problem. I've found a workaround
But thought I'd post this anyway.

Wicket fails to find the fragment markup because my top level html tag
In BasePage.html contains a wicket id which I use to set the class in the
html tag. It seems - I didn't dig too far into wickets internals - that
when searching for fragment markup wicket skips wicket components. Unfortunately
this leaves me with no where to place the fragment markup in the HomePage.html file
as the resulting merged markup html tag contains a wicket id and is skipped over
during the markup search.

If I place the fragment markup at the bottom of BasePage.html the page renders properly
but this is obviously not what fragments are meant for.

Ciaran

Paltrack Pty (Ltd) Reg No 2000/002936/07
Directors: A.J. Mouton (Managing) |  J.G.F. du Plessis | J. vW. Rossouw (Chairman)


This email and any accompanying attachments may contain confidential and proprietary information. This information is private
and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire
communication immediately and are notified that any disclosure, copying or distribution of or taking any action based on this
information is prohibited.

Emails cannot be guaranteed to be secure or free of errors or viruses. The sender does not accept any liability or
responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or
interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever
reason or for its effect on any electronic device of the recipient.

If verification of this email or any attachment is required, please request a hard copy version.
______________________________________
Queries to: helpdesk@paltrack.co.za

Re: Wicket Fragments and Wicket Extends

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

See https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/Fragment.java#L70
<wicket:fragment> should be inside the HTML element to which is
assigned 'markupProvider' component.

Show us your code if you need more help.

On Tue, Apr 3, 2012 at 6:08 PM, Ciaran Liedeman <ci...@paltrack.co.za> wrote:
> Hello,
>
> I've been trying to use fragments in a page but can't seem to get it to work.
> It fails with an error saying No markup found for fragment id...
>
> I used the example as if from the 1.5 javadocs
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/html/panel/Fragment.html
>
> the only difference being my page extends a base page. If I remove the wicket:extend in the html
> and the extends BasePage in the java the fragment markup is found.
>
> I mananged to get it to work with extending the BasePage by placing the fragment code in the BasePage.html
> File but this means all my fragments will have to be placed in that file.
>
> Am I missing something simple? Where should fragment html code be placed for pages that use
> wicket:extend?
>
> Ciaran
>
> Paltrack Pty (Ltd) Reg No 2000/002936/07
> Directors: A.J. Mouton (Managing) |  J.G.F. du Plessis | J. vW. Rossouw (Chairman)
>
>
> This email and any accompanying attachments may contain confidential and proprietary information. This information is private
> and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire
> communication immediately and are notified that any disclosure, copying or distribution of or taking any action based on this
> information is prohibited.
>
> Emails cannot be guaranteed to be secure or free of errors or viruses. The sender does not accept any liability or
> responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or
> interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever
> reason or for its effect on any electronic device of the recipient.
>
> If verification of this email or any attachment is required, please request a hard copy version.
> ______________________________________
> Queries to: helpdesk@paltrack.co.za
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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