Re: Problem using t:output format for numbers
Thanks for the explanation Thiago! I implemented it through a get method and CSS. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-using-t-output-format-for-numbers-tp5551573p5557987.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Problem using t:output format for numbers
Hi, I have a Long object which has to be printed right justified in a table in #,### format. I tried t:output format=literal:#,### value=imps/ This writes it literally as #,### in the output. What I am doing wrong? Also how to right justify it in the column? Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-using-t-output-format-for-numbers-tp5551573p5551573.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem using t:output format for numbers
On Fri, 09 Mar 2012 17:00:42 -0300, hese 1024h...@gmail.com wrote: Hi, Hi! I have a Long object which has to be printed right justified in a table in #,### format. I tried t:output format=literal:#,### value=imps/ This writes it literally as #,### in the output. What I am doing wrong? You can format the number in your Java class if you want. That's what I'd do. Also how to right justify it in the column? CSS. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem using t:output format for numbers
Thanks. I was hoping I could use 'format' to get this done by using something as simple as '%,13d', but looks like I'll have to resort to a java method and CSS. According to tapestry documentation format takes a java.text.Format, so wondering why '#,###' doesn't work. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-using-t-output-format-for-numbers-tp5551573p5551851.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem using t:output format for numbers
On Fri, 09 Mar 2012 19:14:40 -0300, hese 1024h...@gmail.com wrote: Thanks. I was hoping I could use 'format' to get this done by using something as simple as '%,13d', but looks like I'll have to resort to a java method and CSS. According to tapestry documentation format takes a java.text.Format, so wondering why '#,###' doesn't work. Yep, it takes a Format, but you provided a String, and Tapestry itself only provides a coercion from String to DateFormat, not to NumberFormat. Summary: the component is using a DateFormat instead of a NumberFormat. If you passed a NumberFormat to the format parameter, it would work. You can very easily create an OutputNumber component if you want. Or, not so easily, create a binding in which you can specify the value and the format. Regarding the alignment: it should be done by CSS because there's no other way of doing that (unless you want to resort to formatting attributes in HTML, which suck). This is not a limitation of Tapestry: it's just how HTML works. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org