Björn-Peter Tietjens wrote:
Hi all,
i keep getting tis strange error:*
WicketMessage: No get method defined for class: class java.lang.String
expression: id**
Root cause:**
org.apache.wicket.WicketRuntimeException: No get method defined for
class: class java.lang.String expression: id***
when executing this line:
*add(new DropDownChoice("ddArtikel", new PropertyModel(artikel,
"name"), artikelList, new ChoiceRenderer("name", "id")));
*in my class Artikel the "id" property is of type long, when i chang
it to String then it works...
how do i need to do that to make it work as "long"?
I think that PropertyModels (and models in general) expect string return
values for the POJO's getXXX() methods.
You can try to override the getIdValue() method. Something like this:
ChoiceRenderer c = new ChoiceRenderer("name", "id") {
public String getIdValue(Object object, int index) {
return "" + (long)object;
}
};
Note that this code is untested, and intended as explanation.
--
With kind regards,
Jurrie Overgoor
2go-mobile b.v.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]