Re: Incorrect error message?

2014-01-07 Thread Martin Grigorov
Hi Thies,

Please create a quickstart and attach it to Jira.
Maybe we can improve the exception message to have the component path when
available.

Martin Grigorov
Wicket Training and Consulting


On Tue, Jan 7, 2014 at 10:55 PM, Thies Edeling  wrote:

> Hi
>
> With 6.12.0 I have:
>
> val border = new Border("border")
> val l = new Label("l", "label")
> l.setOutputMarkupId(true)
> border.add(l)
>
> and when handling an ajax call, I'm add/replacing it in the wrong spot in
> the hierarchy:
>
> val replacement = new Label("l", "labe2l")
> replacement.setOutputMarkupId(true)
> addOrReplace(replacement)
> target.add(replacement)
>
> Wicket gives me a MarkupNotFoundException which is a little odd and least
> put me in the complete wrong direction. It doesn't seem like the correct
> exception, right?
>
> org.apache.wicket.markup.MarkupNotFoundException: Markup not found for
> Component: [Component id = l]
> at org.apache.wicket.Component.internalRender(Component.java:2347)
> at org.apache.wicket.Component.render(Component.java:2307)
>
>
> gr,
> Thies
>


Re: Incorrect error message?

2014-01-07 Thread Paul Bors
Well, is actually correct.

Let me draw your component tree for you:

Page
- Border "border"
-- Label "l"
- Label "l"

So thus, did you add the "l" label to the Page?

If not, shouldn't the markup error rise?
If you would have defined a wicket:id="l" in the Page's HTML then you'd get
a missing component by ID 'l".

At least if I remember how those 2 exception work. I haven't gotten them in
a while since we have tools in our IDEs to ensure that Java's and HTML's
component tree match. See the Eclipse market place or IntelliJ IDEA's
plugin market places and search for "Wicket" :)


On Tue, Jan 7, 2014 at 3:55 PM, Thies Edeling  wrote:

> Hi
>
> With 6.12.0 I have:
>
> val border = new Border("border")
> val l = new Label("l", "label")
> l.setOutputMarkupId(true)
> border.add(l)
>
> and when handling an ajax call, I'm add/replacing it in the wrong spot in
> the hierarchy:
>
> val replacement = new Label("l", "labe2l")
> replacement.setOutputMarkupId(true)
> addOrReplace(replacement)
> target.add(replacement)
>
> Wicket gives me a MarkupNotFoundException which is a little odd and least
> put me in the complete wrong direction. It doesn't seem like the correct
> exception, right?
>
> org.apache.wicket.markup.MarkupNotFoundException: Markup not found for
> Component: [Component id = l]
> at org.apache.wicket.Component.internalRender(Component.java:2347)
> at org.apache.wicket.Component.render(Component.java:2307)
>
>
> gr,
> Thies
>


Incorrect error message?

2014-01-07 Thread Thies Edeling
Hi

With 6.12.0 I have:

val border = new Border("border")
val l = new Label("l", "label")
l.setOutputMarkupId(true)
border.add(l)

and when handling an ajax call, I'm add/replacing it in the wrong spot in
the hierarchy:

val replacement = new Label("l", "labe2l")
replacement.setOutputMarkupId(true)
addOrReplace(replacement)
target.add(replacement)

Wicket gives me a MarkupNotFoundException which is a little odd and least
put me in the complete wrong direction. It doesn't seem like the correct
exception, right?

org.apache.wicket.markup.MarkupNotFoundException: Markup not found for
Component: [Component id = l]
at org.apache.wicket.Component.internalRender(Component.java:2347)
at org.apache.wicket.Component.render(Component.java:2307)


gr,
Thies