【问题标题】:t:selectOneRadio is not working in tomahawk version 2.0t:selectOneRadio 在 tomahawk 2.0 版中不起作用
【发布时间】:2011-07-05 11:30:05
【问题描述】:

我正在使用http://myfaces.apache.org/core20/index.htmlhttp://myfaces.apache.org/tomahawk-project/tomahawk20/tagdoc/t_selectOneRadio.html

我在我的 jsf 页面中使用了 tomahawk <t:selectOneRadio>

<t:selectOneRadio id="myScript" value="#{bean.myScript}" layout="spread">
    <f:selectItem itemLabel="" itemValue="Every" />
    <f:selectItem itemLabel="" itemValue="Every weekday" />
</t:selectOneRadio>

<t:radio for="myScript" index="0" />
<t:radio for="myScript" index="1" />

我无法查看单选按钮,其中相同的代码在 JSF 1.1 中与 jboss6 中的等效 Tomahawk 库正常工作。

【问题讨论】:

  • 非常感谢任何想法
  • 我认为问题出在 itemLabel="" 上。尝试在那里添加一些东西以查看它的工作原理,但理论上代码应该可以工作。

标签: html jsf jsf-2 tomahawk


【解决方案1】:

你应该把你想要展示给用户的内容放在 itemLabel 属性中,并在 itemValue 中放置一个标识符

像这样

<t:selectOneRadio id="myScript" value="#{bean.myScript}" layout="spread">
    <f:selectItem itemLabel="Every" itemValue="every" />
    <f:selectItem itemLabel="Every weekday" itemValue="everyWeekday" />
</t:selectOneRadio>

<t:radio for="myScript" index="0" />
<t:radio for="myScript" index="1" />

问候

【讨论】:

    猜你喜欢
    • 2011-02-27
    • 1970-01-01
    • 2012-09-22
    • 1970-01-01
    • 2011-07-22
    • 1970-01-01
    • 2020-03-21
    • 2015-12-11
    • 2014-12-15
    相关资源
    最近更新 更多