How to add placeholder attribute to JSF input component?

后端 未结 9 909
耶瑟儿~
耶瑟儿~ 2020-11-28 09:19

Shouldn\'t this line of code render a inputtext field with the placeholder text \"fill me\" when using html5?


         


        
9条回答
  •  渐次进展
    2020-11-28 09:47

    You can achieve it either with placeholder attribute or with p:watermark if using Primefaces and JSF 2.0+ or, when JSF 2.2 available, you can use pt:placeholder attribute.

    Primefaces

      
    

    Legacy browser support (Adds JS solution):

      
    
    

    JSF 2.2 (without PF)

    
        
        
        
            
        
    
    

    Which basically generates an HTML 5

    
    

    Check out this answer.

提交回复
热议问题