You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2006/01/26 16:43:35 UTC

JSTL formatting for displaytag column

Have an object Account which has couple of attributes in it.

using displaytag to show all the accounts.

<display:table name="accountscoll" requestURI="PrepareSummaryAction.do">
        <display:column property="accountNumber" />
        <display:column property="accountType">
        <display:column property="balance">
               <fmt:formatNumber value="${}" type="currency"/>
        </display:column>
...................
................
</display:table>

want to display the values in the column as $1000 or so. i.e prefix the 
value with dolar sign.

I am not sure what the value="${}" would be.

accountcoll has List of Account objects.

Thanks.

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: JSTL formatting for displaytag column

Posted by Keith Sader <ks...@gmail.com>.
What you want is the following:
<fmt:formatNumber type="currency" currencyCode="USD" value='${balance}'/>

On 1/26/06, fea jabi <zy...@hotmail.com> wrote:
> Have an object Account which has couple of attributes in it.
>
> using displaytag to show all the accounts.
>
> <display:table name="accountscoll" requestURI="PrepareSummaryAction.do">
>         <display:column property="accountNumber" />
>         <display:column property="accountType">
>         <display:column property="balance">
>                <fmt:formatNumber value="${}" type="currency"/>
>         </display:column>
> ...................
> ................
> </display:table>
>
> want to display the values in the column as $1000 or so. i.e prefix the
> value with dolar sign.
>
> I am not sure what the value="${}" would be.
>
> accountcoll has List of Account objects.
>
> Thanks.
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
Keith Sader
ksader@gmail.com
http://www.saderfamily.org/roller/page/ksader
http://www.jroller.com/page/certifieddanger

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: JSTL formatting for displaytag column

Posted by Torgeir Veimo <to...@pobox.com>.
On Thu, 2006-01-26 at 10:43 -0500, fea jabi wrote:

> <display:table name="accountscoll" requestURI="PrepareSummaryAction.do">
>         <display:column property="balance">
>                <fmt:formatNumber value="${}" type="currency"/>
>         </display:column>
> </display:table>

> I am not sure what the value="${}" would be.

You can add an id="row" to the display:table tag, and use
${row.balance}.

-- 
Torgeir Veimo <to...@pobox.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org