[ 
https://issues.apache.org/jira/browse/WICKET-6266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebastian Gooren updated WICKET-6266:
-------------------------------------
    Attachment: Quickstart-custom-markup.zip

Hi Andrea!

I need to reopen this as we've encountered another case which breaks for us on 
wicket 7.5.0 for the same reason.

Please see the attached quickstart.

In a nutshell: we have a CMS which allows users to create content and manage 
components inside that content.
At runtime we generate html for wicket to parse and build a component tree 
dynamically.
Our parsing layer has caching so we decided not to let wicket cache the markup 
(hence we return a {{null}} markup cache key), which should be fine.

How should we change our code to make this work in 7.5.0? Since the html and 
component tree are dynamic, I'm a bit hesitant to let wicket cache it.

I also wonder about the change in 7.5.0: in our case (where we have a 
variation, but for most cases no custom markup for that variation), wicket will 
ignore the {{markup}} "cache" on the {{Component}} in many components, and 
needs to ask the markup sourcing strategy to find it.

Since many variations can lead to the same markup (e.g. a default file), 
{{Component#markupHasCurrentVariation()}} will return {{false}}, even when the 
markup was in fact resolved for that variation.

> Component resolvers & variation broken in 7.5.0
> -----------------------------------------------
>
>                 Key: WICKET-6266
>                 URL: https://issues.apache.org/jira/browse/WICKET-6266
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 8.0.0-M2, 7.5.0
>            Reporter: Sebastian Gooren
>            Assignee: Andrea Del Bene
>         Attachments: Quickstart-custom-markup.zip, quickstart.zip
>
>
> Auto components fail to render in certain cases due to changes in 
> https://issues.apache.org/jira/browse/WICKET-6231.
> See attached quickstart.
> If you use a component resolver in a page which overrides {{getVariation()}}, 
> but the html file for that page is the "default" one (without the variation 
> in the filename), wicket throws an RTE (MarkupNotFoundException: Markup not 
> found for Component: [WebMarkupContainer [Component id = custom0]]).
> Debugging reveals that this is caused by the change to 
> {{Component#getMarkup()}}. The markup that is set for auto-components might 
> not have the same variation as the html file in which it is used. Because of 
> this, the new {{markupHasCurrentVariation()}} returns {{false}}, and we fall 
> through to the end of {{getMarkup()}}. As the auto-component is dynamically 
> added on each render, {{parent.getMarkup(this)}} returns {{null}} - the 
> markup id gets created on the fly by component resolvers.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to