Em Wed, 23 Sep 2009 17:58:08 -0300, neo anderson <javadeveloper...@yahoo.co.uk> escreveu:

I have an domain object named User, in which it has a field called `account'. However, the User object only provide method getAccount(), but does not
provide method setAccount(String account).

BeanModelSource (used when a BeanModel is needed and you don't provide one) ignores read-only properties. It doesn't care about fields, just about getters and setters.

In the page object e.g. Register, in which I build a BeanModel using
BeanModelSource.create(User.class, ...)

This method is deprecated. use createDisplayModel() or createEditModel() instead.

1.) in the Register page object, BeanModel does not use
`BeanModel.add("account",null).label("Account").sortable(false)' method to create account field.

Error:
aused by: java.lang.RuntimeException: Bean editor model for User does not
contain a property named 'account'.  Available properties: address, name,
password, sex.

You can't reorder a model using some property that doesn't exist.

Caused by: java.lang.RuntimeException: Bean editor model for User already
contains a property model for property 'account'.

You can't add the same property twice in the same model.

What is the correct way to add a column that the User object doesn't provide get/set method at the same time?

For BeanEditForm or BeanEditor, you'll need to provide your own PropertyConduit to model.add(String property, PropertyConduit conduit).

--
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

Reply via email to