Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在JSF组件中显示previewtext?_Java_Jsf - Fatal编程技术网

Java 如何在JSF组件中显示previewtext?

Java 如何在JSF组件中显示previewtext?,java,jsf,Java,Jsf,如果用户点击其中一个组件,是否可以在JSF 1.2组件中显示previewtext,例如在inputfields、selectmenue或outputtext中,并且预览文本消失 例如,我看到属性defaultLabel可以用于Rich faces?JSF组件是否具有类似的属性 谢谢,格里茨 Marwief如果要使用占位符,可以查找素面或RichFaces 另一种方法:看看JSF2.2的passthrough <html xmlns="http://www.w3.org/1999/xhtm

如果用户点击其中一个组件,是否可以在JSF 1.2组件中显示previewtext,例如在inputfields、selectmenue或outputtext中,并且预览文本消失

例如,我看到属性defaultLabel可以用于Rich faces?JSF组件是否具有类似的属性

谢谢,格里茨
Marwief

如果要使用占位符,可以查找素面或RichFaces

另一种方法:看看JSF2.2的passthrough

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:f="http://xmlns.jcp.org/jsf/core"
  xmlns:p="http://xmlns.jcp.org/jsf/passthrough">

<h:inputText value="#{item.name}" p:placeholder="my item"/>
 ...

...
将呈现为:

 <input type="text" ... placeholder="my item">


但请注意,这是HTML5

例如,我使用了label属性