我可以将表达式传递给JSF 2 passthrough-attributes吗?以下代码无效.#{country.isoCode}
不评估表达式.
<h:selectOneMenu value="#{bean.selectedCountry}" styleClass="selectlist">
<f:selectItems
value="#{bean.countries}" var="country"
itemLabel="#{country.countryName}"
pt:data-icon="flag flag-#{country.isoCode}"/>
</h:selectOneMenu>
Run Code Online (Sandbox Code Playgroud)
我正在使用命名空间
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
Run Code Online (Sandbox Code Playgroud)
和bootstrap-select.属性"data-icon"用于显示图像.看到:
http://silviomoreto.github.io/bootstrap-select/#data-icon
渲染输出:
<i class="glyphicon flag flag-"></i>
Run Code Online (Sandbox Code Playgroud) 似乎使用passthrough
命名空间使用某些HTML 5属性存在错误,即:
<h:inputText id="text1" p:autofocus p:placeholder="this is a placeholder text"></h:inputText>
Run Code Online (Sandbox Code Playgroud)
当我尝试在Glassfish中运行页面时出现此错误:
Error Parsing /index.xhtml: Error Traced[line: 19] Attribute name "p:autofocus" associated with an element type "h:inputText" must be followed by the ' = ' character.
Run Code Online (Sandbox Code Playgroud)
请注意,占位符属性可以正常工作,只需要不需要指定值(=""
),例如autofocus
失败.
这是一个已知的错误?