BindingException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

BindingException

martin stanik
Hallo,

i am getting BindingException, when my program tries save data from form to
bean.
My page file is following:

<page-specification class="examples.CreateAccountPage">
        <property-specification name="account" type="examples.Account"/>

        <component id="balance" type="TextField">
                <binding name="value" expression="account.balance"/>
        </component>

In exception dump is stated, that my class does not have setBalance(String)
method.
This is right, as there is just setBalance(BigDecimal) method.
I am complete beginner and i do not know how to configure this
without duplication properties of examples.Account in
examples.CreateAccountPage.
Can I somehow explain to tapestry type of account.balance property?

thanks martin

_________________________________________________________________
Flirt bez vyslovenia jedineho slova s MSN Messenger 6.2
http://messenger.msn.sk/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: BindingException

Erik Hatcher

On May 12, 2005, at 8:54 AM, martin stanik wrote:

> Hallo,
>
> i am getting BindingException, when my program tries save data from  
> form to bean.
> My page file is following:
>
> <page-specification class="examples.CreateAccountPage">
>     <property-specification name="account" type="examples.Account"/>
>
>     <component id="balance" type="TextField">
>         <binding name="value" expression="account.balance"/>
>     </component>
>
> In exception dump is stated, that my class does not have setBalance
> (String) method.
> This is right, as there is just setBalance(BigDecimal) method.
> I am complete beginner and i do not know how to configure this
> without duplication properties of examples.Account in  
> examples.CreateAccountPage.
> Can I somehow explain to tapestry type of account.balance property?

TextField only works with String (sadly).

You will either need to convert to/from a String or use the  
ValidField component instead (check the docs to get the details on  
how to use ValidField).

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: BindingException

martin stanik
Yes, it makes sense - in order to obtain a number from user, at least basic
(number format)
validation is necessary. TextField probably does not provide any. There is
only way here - read component reference. If i spent a week reading it, i
could save 2 sick days :-)))

Many thanks, Erik!



>
>TextField only works with String (sadly).
>
>You will either need to convert to/from a String or use the  ValidField
>component instead (check the docs to get the details on  how to use
>ValidField).
>
>     Erik

_________________________________________________________________
MSN Pocasie vam umozni naplanovat si den a tyzden. http://www.msn.sk/weather


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]