On Fri, 28 Mar 2003, Jerome Jacobsen wrote:

> 
> 
> >
> > However, it might still be useful to provide another tag that can do
> > simple formatting of strings/numbers/etc if a good one doesn't already
> > exist. I've got a couple simple ones I've written for formatting numbers
> > with commas and dollar signs and stuff. I agree with Benjamin that this
> > should not be the focus of our development.
> >
> 
> I think it was suggested to use tags inside the column tag body for
> "decorating".  To support this the new design should make the current row
> available as a scripting variable and/or a scoped variable.  Then you could
> decorate using JSP.  For example, say you want to format a column as a
> currency.  Assuming the scoped variable for the current iteration is set by
> the var attribute (following JSTL convention), then we could do something
> like this.
> 
> <display:table var="row" ...>
>  <display:column property="salary">
>   <fmt:formatNumber type="currency" value="${row.salary}"/>
>  </display:column>
>  <display:column property="hireDate">
>   <fmt:formatDate value="${row.hireDate}"/>
>  </display:column>
>  ...
> </display:table>

Exactly. That's precisely what my refactored tag is doing and it works 
very well.




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to