- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何转义f:SelectItem itemLabel
属性,以便可以在标签中添加超链接?
使用以下代码,我可以转义h:outputText
,但不能转义f:selectItem
。
<h:outputText value="MyLink <a href="http://google.com" >Google </a>" escape="false"/>
<h:selectOneRadio id="p" value="#{bean.somevalue}" required="true" >
<f:selectItem escape="false" escapeItem="false" itemLabel="One <a href="http://google.com" >Google </a>" itemValue="O" />
<f:selectItem escape="false" escapeItem="false" itemLabel="Two <a href="http://stackoverflow.com" >Stackoverflow</a>" itemValue="T" />
</h:selectOneRadio>
最佳答案
这是JSF中的一个记录错误。 actual attribute名为itemEscaped
,而不是escapeItem
(as incorrectly documented in VDL)或escape
(Eclipse自动完成功能确实出于某些未知原因而自动建议使用,但实际上在VDL中完全不存在)。
以下构造应该为您工作(至少在Mojarra 2.1.17上对我有用):
<h:selectOneRadio>
<f:selectItem itemEscaped="false" itemLabel="One <a href="http://google.com" >Google </a>" itemValue="O" />
<f:selectItem itemEscaped="false" itemLabel="Two <a href="http://stackoverflow.com" >Stackoverflow</a>" itemValue="T" />
</h:selectOneRadio>
关于jsf - 如何逃避:selectItem itemLabel attribute,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14238646/
如何转义f:SelectItem itemLabel属性,以便可以在标签中添加超链接? 使用以下代码,我可以转义h:outputText,但不能转义f:selectItem。
我的 JSF 页面 转换器类(StudentConverter) public Object getAs
当我创建一个新的 SelectList 时,我(只是有时想)在 SelectList.CreateDropDown() 中看到 defaultValueItemLabel 选项。评论说 The lab
当我使用 f:selectItems 在 Map 中显示项目时,我无法显示 Map 项目的值,只能显示键。 f:selectItems 根本不使用 itemLabel。当我使用 List 代替时,一切
我需要将条形图的 itemLabels 旋转大约 90°,以便它们具有垂直方向。 itemLabels 不是轴上的那些,而是条上方的那些。我必须这样做,否则 itemLabels 会重叠。我知道有一些
我有 2 件元素: 单选按钮 输出文本 我想做的是:当用户检查单选按钮时 -> 在我的输出文本中获取选中的单选按钮的 itemLabel 。 (不是 itemValue) 我有以下代码,在输出文本中显
我正在为我的一个应用程序使用 CF 饼图。但它的工作很奇怪。以下代码是图表代码,它给出了错误。它甚至不显示图表。我知道,这是由于查询列的值中存在双引号,col1 . fun
我的 create.jspx 中有一行,如下所示: 此字段显示一个框,其中的行由 2 个实体之间的关系 @ManyToMany 填充。 现在的问题是,第一个实体只有一个填充此框的 String 属性
据我所知,在 SelectOneMenu 中显示信息的正确方法是拥有一个对象列表并使用它的属性,如下所示: 但是如果我没有玩家列表怎么办,如果我有这样的东西怎么办?我想让它
我在 Facelets 页面中有以下下拉列表: 问题是,无论我输入什么 itemLabel (JSF EL 表达式或纯文本),它不显示。知道我做错了什么吗? 这是ContactConve
如何使用 javascript 获取 itemLabel 表单 JSP 的值? 最佳答案 您可以使用getAttribute()获取 itemValue 值的方法如下: //getting att
我正在使用 Spring。我有一个带有表单的 JSP:在其中选择显示用户列表。在这种情况下,用户名或 id 对用户来说意义不大,所以我需要显示 firstname lastname。 我试过了:
我正在从 IceFaces 更改为 PrimeFaces(我真的很想更改为 RichFaces,但会在新版本中导致错误,我不会),并且我在正确实现 primefaces 自动完成方面遇到了一些困难。根
我是一名优秀的程序员,十分优秀!