3
是否可以在我的<f:selectItem itemLabel="label" />
附近设置<a href />
,我的链接文本是itemLabel
?SelectItem标签中的JSF链接
我使用的是简单的太阳组件。
是否可以在我的<f:selectItem itemLabel="label" />
附近设置<a href />
,我的链接文本是itemLabel
?SelectItem标签中的JSF链接
我使用的是简单的太阳组件。
期望的结果是而不是可能在HTML中。你需要为此添加一个JavaScript镜头。
<h:selectOneMenu onchange="window.location=this.options[this.selectedIndex].value">
<f:selectItems value="#{bean.links}" />
<h:selectOneMenu>
凡bean.getLinks()
与fullworthy URL作为项目值返回List<SelectItem>
。如果您想要显示链接均为值和标签,只需使用带有单个参数的SelectItem
构造函数。
links = new List<SelectItem>();
links.add(new SelectItem("http://google.com"));
links.add(new SelectItem("http://stackoverflow.com"));
// ...
如果你想硬编码它们的观点,那么你当然可以抢f:selectItem
:
<h:selectOneMenu onchange="window.location=this.options[this.selectedIndex].value">
<f:selectItem itemValue="http://google.com" />
<f:selectItem itemValue="http://stackoverflow.com" />
<h:selectOneMenu>
是HTML可能期望的结果? f:selectItem的父级是什么? – Bozho 2010-02-01 12:34:34