OK,

I think I understand now.

Martin Grigorov
Wicket Training and Consulting


On Mon, Mar 17, 2014 at 1:31 PM, Jens Jahnke <j...@wegtam.com> wrote:

> Hi,
>
> On Mon, 17 Mar 2014 13:05:57 +0200
> Martin Grigorov <mgrigo...@apache.org> wrote:
>
> MG> This is the right way.
> MG> Can you show us the code that causes this error ?
> MG> #startComponentInPage() should not fail with such error ...
>
> the exception is thrown at the line with tester.startComponentInPage,
> but here is the code of my custom panel:
>
> public class MyCustomPanel extends Panel {
>     protected String name = "";
>     protected String icon = "";
>     protected String genre = "";
>     protected String description = "";
>
>     public MyCustomPanel(String id, IModel<MyDataModel> model) {
>         super(id, model);
>         prepareDefaultVariables(model.getObject());
>     }
>
>     protected void prepareDefaultVariables(MyDataModel data) {
>

This method doesn't add the children components.
So trying to render this panel (via #startComponentInPag(panelInstance))
will fail because there are HTML elements with wicket:id in the markup
which have no Java counterparts.


>         name = data.getName();
>         icon = data.getIconName();
>         genre = data.getGenre();
>         description = data.getDescription();
>     }
>
>     protected void renderDefaultVariables() {
>         add(new Label("name", name));
>         PackageResourceReference iconRef = new
> PackageResourceReference(getClass(), icon);
>         add(new Image("icon", iconRef));
>         add(new Label("genre", genre));
>         add(new Label("description", description));
>     }
> }
>
> BTW: I'm using wicket 6.12 and are currently unable to upgrade to 6.14. :-|
>
> Regards,
>
> Jens
>
> --
> 17. Lenzing 2014, 12:19
> Homepage : http://www.wegtam.com
>
>         SAFETY
> I can live without
> Someone I love
> But not without
> Someone I need.
>

Reply via email to