[ 
https://issues.apache.org/jira/browse/WICKET-3045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919210#action_12919210
 ] 

Gabriel Bucher commented on WICKET-3045:
----------------------------------------

i did some additional research/debugging but couldn't find a clean solution to 
provide a patch.

when the 'homelink' (BookmarkablePageLink) component tries to get its markup 
(in Markup.find(String componentId)) it will iterate through all the Markup 
Elements of the MergedMarkup of ProfilePage.html. as soon as the iteration 
reaches the TransparentWebMarkupComponent 'content' it will call 
stream.skipToMatchingCloseTag... in the following block:

                                        if (tag.isOpen() && 
!tag.hasNoCloseTag() && !(tag instanceof WicketTag) &&
                                                !"head".equals(tag.getName()) 
&& !tag.isAutoComponentTag())
                                        {
                                                
stream.skipToMatchingCloseTag(tag);
                                        }

but the markup for the component 'homelink' is actually inside this tag!

TransparentWebMarkupComponents are also used as default component for wicket 
tags like child and extend.... when components are created for those tags 
autoComponent will be set to true so in those cases the skipToMatchingCloseTag 
won't be called.

> using TransparentWebMarkupContainer results in Markup not found for 
> Component...
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-3045
>                 URL: https://issues.apache.org/jira/browse/WICKET-3045
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M2.1
>            Reporter: Gabriel Bucher
>            Assignee: Juergen Donnerstag
>         Attachments: quickstart.tar.gz
>
>
> I used in wicket 1.4.x a WebMarkupContainer (isTransparentResolver = true) to 
> add additional css styles to a div tag.
> if I replace the WebMarkupContainer with the new 
> TransparentWebMarkupContainer, this will result in a 'Markup not found for 
> Component: [BookmarkablePageLink [Component id = homelink]]' Exception in the 
> attached quickstart.tar.gz.
> The missing markup is for a bookmarkable link added to the ProfilePage and 
> the TransparentWebMarkupContainer is part of the AbstractBasePage.
> -- ProfilePage.java ----
> public class ProfilePage extends AbstractBasePage {
>     public ProfilePage(PageParameters parameters) {
>         super(parameters);
>         add( homePageLink("homelink") );
>     }
> }
> -- ProfilePage.html ----
> <html xmlns:wicket>
> <body>
> <wicket:extend>
> <h1>Profile</h1>
> <a wicket:id="homelink" href="#">back to home</a>
> </wicket:extend>
> </body>
> </html>
> -- AbstractBasePage.java ----
> public class AbstractBasePage extends WebPage {
>     public AbstractBasePage(PageParameters parameters) {
>         super(parameters);
>         WebMarkupContainer content = new 
> TransparentWebMarkupContainer("content");
>         add(content);
>     }
> }
> -- AbstractBasePage.html ----
> <html xmlns:wicket>
> <body>
> <div id="header">header</div>
> <div id="main">
>   <div id="sidebar">sidebar</div>
>   <div wicket:id="content" id="content">
>     <wicket:child/>
>   </div>
> </div>
> <div id="footer">footer</div>
> </body>
> </html>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to