The reason why setAccount is removed is because account field is purposed to
be created only when user registers. It is not purposed to be altered once
the account is created. So the to remove setAccount(String) is to prevent
other class falsely calling setAccount(String) accidentally. 

In fact, if I enable setAccount(String), the beaneditform would work without
previous problem; however, I would like to know if beaneditform can work as
my original purpose. If it is impossible, I can enable setAccount(String),
but it's a bit pity that it can not work as expected. 

Thanks for your help.


Kalle Korhonen-2 wrote:
> 
> Why do you want to include the field then? For display purposes? Why
> don't you just simply:
>        public void setAccount(String account){
>                // do nothing
>        }
> 
> then override the property in the template just to output the value
> rather than render a field?
> 
> Kalle
> 
> On Tue, Sep 29, 2009 at 11:17 AM, neo anderson
> <javadeveloper...@yahoo.co.uk> wrote:
>>
>> Yes, the User bean contains property named account. But inside the bean
>> it
>> does not provide setter method because it is purposed to setup when the
>> bean
>> is created e.g. new User(id, account).
>>
>> The User bean looks as below:
>>
>> @Entity
>> @Table(name="USERS")
>> public class User implements Serializable{
>>
>>       �...@id
>>        private String id;
>>
>>       �...@column(name="ACCOUNT")
>>        private String account;
>>
>>        ...
>>
>>        public User(String id, String account, String name, String
>> password){
>>                this.id = id;
>>                this.account = account;
>>                this.name = name;
>>                this.password = password;
>>        }
>>
>>
>>        public String getAccount(){
>>                return this.account;
>>        }
>>
>>        /*
>>        public void setAccount(String account){
>>                this.account = account;
>>        }
>>        */
>>        ...
>> }
>>
>>
>> cordenier christophe wrote:
>>>
>>> But i see in your code
>>>
>>> <t:textField t:id="account" t:model="user" t:value="user.account"
>>> t:validate="required,regexp"/>
>>>
>>> Does the User bean has an account property ?
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Bean-editor-model-for-User-already-contains-a-property-model-for-property-%27account%27-tp25531292p25668232.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
>>
>>
> 
> ---------------------------------------------------------------------
> 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-tp25531292p25671514.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

Reply via email to