I didn't read the entire thread, but if this particular field has no setter you can add a synthetic
property with model.add("account", null) and then provide a proper block override as
outlined in the guide under "Property Editor Overrides":
http://tapestry.apache.org/tapestry5.1/guide/beaneditform.html
On Wed, 30 Sep 2009 03:27:09 +0200, neo anderson <javadeveloper...@yahoo.co.uk>
wrote:
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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org