You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Moacir Cardoso <mo...@yahoo.com.br> on 2007/11/01 02:59:35 UTC
Problems with Number Format
Hello,
I want to show in my textfield control a formated value.
In my globalMessages.properties I've this
format.number={0,number,###,##0.00}
This code works fine
<s:text name="format.number"><s:param name="value" value="myFieldValue"
/></s:text>
But can't use it with a <s:textfield name="myFieldValue"
id="myFieldValue" label="myFieldValue:"/> and apply the format to it.
?????? help!!!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Problems with Number Format
Posted by Moacir Cardoso <mo...@yahoo.com.br>.
Hi everyone,
I've found the source off my problem.
It seams that if you want to format a value in s:textfield tag you have to:
<s:text id="myFieldValueID" name="format.number"><s:param name="value"
value="myFieldValue" /></s:text>
<s:textfield id="txtmyFieldValue" name="myFieldValue"
value="%{myFieldValueID}"/>
The magic trick is the id attribute of s:text tag.
But will have some problems if I don't initialize myFieldValue in the
default constructor of my action and I don't know why.
Moacir Cardoso escreveu:
> Hello,
> I want to show in my textfield control a formated value.
>
> In my globalMessages.properties I've this
> format.number={0,number,###,##0.00}
>
> This code works fine
> <s:text name="format.number"><s:param name="value"
> value="myFieldValue" /></s:text>
>
> But can't use it with a <s:textfield name="myFieldValue"
> id="myFieldValue" label="myFieldValue:"/> and apply the format to it.
>
> ?????? help!!!
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org