> Most of the time, the class names are right, but sometimes, I don't
> get Wicket org names, I get these:
> 
> com.mycompany.MyForm.MyPanel$1   ( <-- on a Button!)
> com.mycompany.SomeForm$1           ( <-- on a Button!)
> 
> What's going on here, why can't I get the actual
> org.apache.wicket.markup.html.form.Button class names?

That's Java for you. When you create a button like this:

class MyPage {
  ...
  new Button() {
    ...
  }
}

...then you actually create a new class at that spot. It's anonymous,
so it doesn't have a really usable name, but internally, the compiler
and VM use <enclosingclassname>$<someindexvalue> to create that name.
Thus, you get MyPage$1 if this is the first anonymous subclass you
create within MyPage.

My usual solution to this is to not just print out the class name, but
first check whether the class name contains a "$", and if so, get the
superclass instead.

Carl-Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to