标签: passthrough-attributes

在passtrough属性中使用f:selectItems var

我可以将表达式传递给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)

el selectonemenu jsf-2 managed-bean passthrough-attributes

6
推荐指数
1
解决办法
2956
查看次数

与元素类型"h:inputText"关联的属性名称"p:autofocus"必须后跟"="字符

似乎使用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失败.

这是一个已知的错误?

jsf html5 facelets jsf-2.2 passthrough-attributes

2
推荐指数
1
解决办法
1494
查看次数