Hi,
I have a DropDownChoice in a form, with markup:
<select wicket:id="authors" />
In my Form class, I add it like this:
add(new DropDownChoice("authors", new
PropertyModel(this.article, "articleAuthorId"),
acService.getAuthors(), new
ChoiceRenderer("authorDisplayName", "articleAuthorId")));
this.article refers to a class that has a property of articleAuthorId:
public long getArticleAuthorId() {
return articleAuthorId;
}
public void setArticleAuthorId(long articleAuthorId) {
this.articleAuthorId = articleAuthorId;
}
The acService.getAuthors() call gets a list of Author objects:
public class Author implements Serializable {
private long articleAuthorId;
private String authorFirstName;
private String authorMiddleName;
private String authorLastName;
private String authorDisplayName;
public String getAuthorFirstName() {
return authorFirstName;
}
public void setAuthorFirstName(String authorFirstName) {
this.authorFirstName = authorFirstName;
}
public String getAuthorMiddleName() {
return authorMiddleName;
}
public void setAuthorMiddleName(String authorMiddleName) {
this.authorMiddleName = authorMiddleName;
}
public String getAuthorLastName() {
return authorLastName;
}
public void setAuthorLastName(String authorLastName) {
this.authorLastName = authorLastName;
}
public String getAuthorDisplayName() {
return authorDisplayName;
}
public void setAuthorDisplayName(String authorDisplayName) {
this.authorDisplayName = authorDisplayName;
}
public Long getId()
{
return new Long(getArticleAuthorId());
}
public long getArticleAuthorId() {
return articleAuthorId;
}
public void setArticleAuthorId(long articleAuthorId) {
this.articleAuthorId = articleAuthorId;
}
}
The error I get when I try to render the page is:
WicketMessage: No get method defined for class: class java.lang.Long
expression: articleAuthorId
I don't understand this, as the class used for the choices is Author, not
java.lang.Long ....
Any help appreciated!
Thanks
_______________________________________________________
The information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial use of the individual or entity to which it is
addressed and may contain information that is propri-
etary and confidential. If you are not the intended
recipient of this message you are hereby notified that
any review, dissemination, distribution or copying of
this message is strictly prohibited. This communica-
tion is for information purposes only and should not
be regarded as an offer to sell or as a solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be secure or error-
free. P6070214