小编Ste*_*eve的帖子

在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
查看次数