how to add placeholder text in the filter box in datatable column headers

后端 未结 5 1659
暖寄归人
暖寄归人 2021-01-21 14:31

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

5条回答
  •  星月不相逢
    2021-01-21 14:54

    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:

    
        
    
            
                
                    
                    
                
            
    
            
                
                    
                    
                
            
    
        
    
    

提交回复
热议问题