7 Replies Latest reply: Feb 18, 2014 1:10 AM by Alex Supertramp RSS

Add NumberConverter to RichOutputText in Bean

Alex Supertramp Newbie
Currently Being Moderated

Hello everyone. Please help me!

 

I created RichTable in backing bean and displayed it. Everything is OK. But in the table, there is a column display amount. I added NumberConverter to RichOutputText to display like 1,234,567. But it doesn't work. Here is my code:

 

RichTable rt = new RichTable();

.....

set table value

.....

add RichColumn to RichTable rt:

...

RichColumn rc = new RichColumn();

RichOutputText rot = new RichOutputText();             

rot.setValueExpression("value", ve);

if (columntype.equals("NUMBER")){                   

     NumberConverter nc = new NumberConverter();               

     nc.setGroupingUsed(true);              

     nc.setPattern("#,##0.###");                   

     rot.setConverter(nc);

}

rc.getChildren().add(rot);     

rt.getChildren().add(rc);  

...

Please help me, thanks you and regards.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points