I tried changing both the property being set by the DropDownChoice and the property used in the Author class to Long, and it didn't make any difference.... any help appreciated!
Thanks -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Gravener Sent: Thursday, April 17, 2008 4:23 PM To: users@wicket.apache.org Subject: Re: DropDownChoice problem Use Long instead of long On Thu, Apr 17, 2008 at 5:05 PM, Andrew Broderick <[EMAIL PROTECTED]> wrote: > 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 > -- Ryan Gravener http://ryangravener.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]