The reason to remove the setter method (setAccount(String)) is because the filed `account' is originally purposed to be created once only when e.g. user registers. Therefore, the account field would not be changed/ edited after User object created.
But it looks like BeanModel can not add e.g. account value using non default constructor, setter method (setAccount(String)) seemingly is unavoidable. Thanks for your help. I really appreciate it. Thiago H. de Paula Figueiredo wrote: > > Em Tue, 29 Sep 2009 18:35:39 -0300, neo anderson > <javadeveloper...@yahoo.co.uk> escreveu: > >> If I tried to delete the account property first (e.g. >> exclude("account"). Is >> this correct?), then adding using model.add("account"). The error becomes > > You should use model.add("account", somePropertyConduitInstance) in this > case. > >> Now it looks like the problem is because account is a read only field >> (because I remove setAccount(String) method). Is there any chance to let >> it automatically call e.g. constructor such as new User(account, name, >> ...) > > No. It's the same as saying that everytime you need to set a property in > an object, you need to create another object. > > Just add the setter for the account property. If you need to edit it after > you created an object, you can't avoid having a setter. > > -- > Thiago H. de Paula Figueiredo > Independent Java consultant, developer, and instructor > http://www.arsmachina.com.br/thiago > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://www.nabble.com/Bean-editor-model-for-User-already-contains-a-property-model-for-property-%27account%27-tp25531292p25673590.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org