Hi,

is it intended that any wicket:enclosure breaks if it is depending on a 
component that is not added in the constructor but in "onBeforeRender"?

e.g:

<wicket:enclosure child="version">
        <tr>
        <th>Bezeichnung:</th>
        <td wicket:id="version">value</td>
        </tr>
</wicket:enclosure>

with java:
public HomePage(final PageParameters parameters) {
                super(parameters);
                add(new Label("version", 
getApplication().getFrameworkSettings().getVersion()));
    }

works while if you delay it to:

@Override
        protected void onBeforeRender() {
                super.onBeforeRender();
                add(new Label("version", 
getApplication().getFrameworkSettings().getVersion()));
        }

it breaks with:

12:00:25.172 [main] WARN  RequestCycleExtra - ********************************
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.666 sec <<< 
FAILURE! - in com.mycompany.TestHomePage
homepageRendersSuccessfully(com.mycompany.TestHomePage)  Time elapsed: 0.589 
sec  <<< ERROR!
org.apache.wicket.WicketRuntimeException: Could not find child with id: version 
in the wicket:enclosure
        at 
org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295)




Best,

KB

Reply via email to