This little example works (see attachments). It is based on a
<wicket:component> which add it children within the the constructor.
This is not especially nice, but it works.

I'm currently thinking about moving (relocating) components from the
parent's child list into the <wicket:componet> component. That is, you
add it in your constructor and once <wicket:components> gets rendered,
it relocated it's parents childs with matching name. Just an idea. Let
see if that is at all feasible.

Juergen
/*
 * $Id: HelloWorld.java,v 1.2 2004/12/19 21:27:52 eelco12 Exp $
 * $Revision: 1.2 $
 * $Date: 2004/12/19 21:27:52 $
 *
 * ====================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package wicket.examples.helloworld;

import wicket.PageParameters;
import wicket.examples.util.NavigationPanel;
import wicket.markup.html.HtmlPage;
import wicket.markup.html.basic.Label;


/**
 * Everybody's favorite example.
 * @author Jonathan Locke
 */
public class HelloWorld extends HtmlPage
{
    /**
     * Constructor
     * @param parameters Page parameters
     */
    public HelloWorld(final PageParameters parameters)
    {
        add(new NavigationPanel("mainNavigation", "Helloworld example"));
        //add(new Label("hellomessage", "Hello world!"));
    }
}
/*
 * $Id: HelloWorld.java,v 1.2 2004/12/19 21:27:52 eelco12 Exp $
 * $Revision: 1.2 $
 * $Date: 2004/12/19 21:27:52 $
 *
 * ====================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package wicket.examples.helloworld;

import wicket.markup.html.basic.Label;
import wicket.markup.html.border.Border;


/**
 * Everybody's favorite example.
 * @author Jonathan Locke
 */
public class MyBox extends Border
{
    /**
     * Constructor
     * @param componentName 
     */
    public MyBox(final String componentName)
    {
        super(componentName);
        add(new Label("hellomessage", "Hello world!"));
    }
}
Title: Wicket - Hello World example
Here comes the hello world message...

Reply via email to