jsf-2 - h:selectItems itemLabel 逃脱女巫是不需要的
问题描述
我无法逃脱 selectItems itemLabel 以生成图像
例子:
<h:selectOneRadio layout="pageDirection" styleClass="labelWhite" id="logoRadios" value="#{bean.value}" >
<f:selectItems itemLabelEscaped="false" value="#{imageSources}" var="imgSrc" itemLabel="#{imgSrc}" itemValue="O" />
</h:selectOneRadio>
爪哇:
@Factory("imageSources")
List<SelectItem> imageSourceList= null;
List<Object> allLogos = someService.serviceImplGetAll(var);
imageSourceList= new ArrayList<SelectItem>(allLogos.size());
for(Object value : allLogos)
{
selectableLogos.add(new SelectItem("<img src=\""+ value.getLogoResource() + "\" /> "));
}
return imageSourceList;
生成时我得到的是:
<td>
<input type="radio" name="j_id579:logoRadios" id="j_id579:logoRadios:0" value="<img src="/img/rfcLogos/fall_1.svg" /> ">
<label for="j_id579:logoRadios:0"> <img src="/img/rfcLogos/fall_1.svg" /> </label>
</td>
我认为这个值是错误的,但现在我更关心它没有呈现 img src 的部分(不仅仅是图片文本)
解决方案
推荐阅读
- dart - 如何计算列表中某个项目的出现次数?- 飞镖
- javascript - WebShare API 不在 iOS 上共享图像:Angular
- python - 我应该为 UDP 客户端绑定一些端口吗?
- laravel - Laravel 范围内的自定义字段
- sql - 使用修改后的主键值导出数据库。微软 SQL
- sql - 如何匹配具有 3 列的表,返回第二列的第一次出现与第三列的第一个非值?
- reactjs - 如何修复打字稿错误(Readonly<{}> & Readonly<{ children?: ReactNode; }>)?
- asp.net-core - ASP.NET CORE 和 BLAZOR:重置密码
- php - 如何在 Laravel 6 中使用 DB::raw 将基于关系的文件放入 CONCAT?
- java - 在java中读取文件的特定部分