I have a prime faces datatable with few columns and have filteryBy attribute for all the columns. How do I add placeholder or watermark to provide hint for users. Any suggestion
I realise this question was asked back in 2012, but I'm hoping this answer may help people wanting to add a watermark to the filter by field in a datatable. I tried using the solutions suggested in the other answers with forElement but could not get the watermark to be displayed. Instead I found two solutions that use the for attribute, the first making use of the styleClass attribute on the p:column element, and the second making use of the jQuery selector within the for attribute. I also found that the p:watermark element needed to be located within the f:facet element used for the header.
The code I used in the for these two solutions is as follows: