将标签列显示为单选按钮

时间:2013-07-07 21:50:25

标签: java jsp struts2 radio-button displaytag

我在获取与单选按钮关联的值时遇到问题,该单选按钮是表中的一列。它不是返回实际的conferenceid,而是将${conf.conferenceid}文本返回给对象selectedConference。有人可以帮助我,我在这里做错了什么。顺便说一句,这段代码正在Glassfish上运行,最近迁移到了JBoss而没有开始工作。以下是html代码:

<display:table id="conf" name="conferences" requestURI="perConfSearchAction.action" pagesize="10">
    <display:column>
        <input type="radio" name="selectedConference" value="${conf.conferenceId}" onclick="getValue()"/>
    </display:column>
    <display:column property="userName" title="Moderator" sortable="true" />
    <display:column property="passcode" title="Public Pin" sortable="true" />
    <display:column property="moderatorPin" title="Moderator Pin" sortable="true" />                                
    <display:column property="confStartDate" title="Start Date" sortable="true" />                                                                
    <display:column property="confStartTime" title="Start Time" sortable="true" />                                
    <display:column property="confEndDate" title="End Date" sortable="true" />                                
    <display:column property="confEndTime" title="End Time" sortable="true" />                                
    <display:column property="confName" title="Subscription" sortable="true" />
</display:table>

1 个答案:

答案 0 :(得分:1)

尝试以下代码

<display:table id="conf" name="conferences" requestURI="perConfSearchAction.action" pagesize="10" uid="row">
  <display:column>
     <input type="radio" name="selectedConference" value="<s:property value='%{#attr.row.id}'/>"/>
  </display:column>
</display:table>