You are right. I think this is the scenario issue. I should use other way
(e.g. intermediate bean) for gethering User information.
Thanks for all your help. That helps me have better understanding on related
Tapestry mechanism.
I appreacite it. : )
cordenier christophe wrote:
>
> If your pu
If your purpose is to secure your bean property, i think you should create
an intermediate bean for your User creation.
Tapestry Form properties are mapped to bean properties, and properties are
set simply via accessors.
Tapestry requires an empty constructor to your bean, and this is how
Tapestry
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/beaneditf
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. ac
Em Tue, 29 Sep 2009 18:35:39 -0300, neo anderson
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
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 tried to delete the account property first (e.g. exclude("account"). Is
this correct?), then adding using model.add("account"). The error becomes
Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException:
Expression 'user.account' for class org.jecommerce.pages.Register is
read-on
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, 2
Em Tue, 29 Sep 2009 15:17:39 -0300, neo anderson
escreveu:
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).
Have you tried to delete the property
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{
But i see in your code
Does the User bean has an account property ?
)
>> >> so
>> >> > that it won't throw this error?
>> >> >
>> >> > Thanks for help.
>> >> >
>> >> >
>> >> >
>> >> > Thiago H. de Paula Figueiredo wrote:
>> >> >>
>> >> &g
t;>
> >>
> >>
> http://www.nabble.com/T5%3A-Working-with-BeanModel-td18231888.html#a18352011
> >>
> >>
> >>
> >>
> >> ccordenier wrote:
> >> >
> >> > What corresponds to line 92 in your code ?
>
t;
>> > What corresponds to line 92 in your code ?
>> >
>> > -----Message d'origine-
>> > De : neo anderson [mailto:javadeveloper...@yahoo.co.uk]
>> > Envoyé : lundi 28 septembre 2009 14:23
>> > À : users@tapestry.
odel-td18231888.html#a18352011
>
>
>
>
> ccordenier wrote:
> >
> > What corresponds to line 92 in your code ?
> >
> > -Message d'origine-
> > De : neo anderson [mailto:javadeveloper...@yahoo.co.uk]
> > Envoyé : lundi 28 septembre 2009 14:
rote:
>
> What corresponds to line 92 in your code ?
>
> -Message d'origine-
> De : neo anderson [mailto:javadeveloper...@yahoo.co.uk]
> Envoyé : lundi 28 septembre 2009 14:23
> À : users@tapestry.apache.org
> Objet : Re: Bean editor model for User already conta
What corresponds to line 92 in your code ?
-Message d'origine-
De : neo anderson [mailto:javadeveloper...@yahoo.co.uk]
Envoyé : lundi 28 septembre 2009 14:23
À : users@tapestry.apache.org
Objet : Re: Bean editor model for User already contains a property model for
property
ean 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 m
del 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
Sorry, the User object should be
public class User{
private String account;
public User(... String account, ...){ ... this.account = account; }
...
public String getAccount(){
return this.account
}
// public void setAccount(String account){
// this.account
gister (the
display of beaneditform for the html web page Register.tml is correctly
shown on the browser).
Error:
Caused by: java.lang.RuntimeException: Bean editor model for User already
contains a property model for property 'account'.
at
org.apache.tapestry5.internal.be
21 matches
Mail list logo