You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by wesleywj2 <we...@yahoo.co.uk> on 2009/06/17 22:53:43 UTC
show empty textfield for integer/double property
hi,
is there any way to remove or not to show the "0" or "0.0" for t:textfield
that bound to integer/double property? in my class file "MyPage.java", i
have
public class MyPage{
@Property
@Persist
private int theValue;
}
for MyPage.tml in t:form:
<input type="text" t:type="TextField" t:value="theValue"/>
it shows "0" because it is integer type in the textfield, what i wanted to
achieve is to not showing anything on the textfield at all. can this be
done?
please advice.
wesley
--
View this message in context: http://www.nabble.com/show-empty-textfield-for-integer-double-property-tp24081871p24081871.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: show empty textfield for integer/double property
Posted by wesleywj2 <we...@yahoo.co.uk>.
thanks Thiago, it works out alright. thanks much
Thiago H. de Paula Figueiredo wrote:
>
> Em Wed, 17 Jun 2009 17:53:43 -0300, wesleywj2 <we...@yahoo.co.uk>
> escreveu:
>
>> hi,
>
> Hi!
>
>> public class MyPage{
>> @Property
>> @Persist
>> private int theValue;
>> }
>
> Try changing the type from int to Integer. As any other ordinary Java int
> field, it is automatically initialized with 0 when the instance is built.
> Null Integer values are shown as blank space in the TextField component.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/show-empty-textfield-for-integer-double-property-tp24081871p24083213.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: show empty textfield for integer/double property
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 17 Jun 2009 17:53:43 -0300, wesleywj2 <we...@yahoo.co.uk>
escreveu:
> hi,
Hi!
> public class MyPage{
> @Property
> @Persist
> private int theValue;
> }
Try changing the type from int to Integer. As any other ordinary Java int
field, it is automatically initialized with 0 when the instance is built.
Null Integer values are shown as blank space in the TextField component.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org