In a datatable column how can i display a text for a number value which is retrieved from database.
for eg if the value for a colum from database is 2 , then i need to display “Cheese” in datatable. similarly if the value is 3 then i need to display “cake”.
You need to maintain a mapping of those values in the backing bean.
Then you can get it as follows
Where
#{item.number}should return the desired number asLong.