为struts 2中的字符串列表制作单选按钮的垂直列表? [英] Making a vertical List of Radio Buttons for a list of strings in struts 2?
问题描述
我正在使用填充了字符串列表的struts单选标签:
I'm using a struts radio tag that is being populated with a list of strings:
我正在使用的视图是:-
View that I am using is :-
<tr>
<td colspan="4">
<s:iterator value="importFiles">
<s:radio name="mifFile" label="Mif File" theme="simple"/>
<s:property/><br>
</s:iterator>
</td>
</tr>
上面,我有一个名为importFiles的字符串列表.使用此方法时,出现错误单选标记中必须具有列表属性".但是我不知道对于简单的字符串列表,我应该在List属性中添加什么.
Above, I have a list of strings named importFiles. While using this, I am getting an error "List attribute necessary in Radio Tag". But I don't know for a simple List of strings what should i put in List attribute.
与以前的帖子类似,但是为了使单选按钮垂直显示,他们以具有两个字段的列表为例.
It is similar to previous posts but for doing vertical show of radio buttons, they have taken a example of List having 2 fields.
在这种情况下,将如何实现?请在这方面帮助我.....
In this case, how will it be achieved? Please help me out in this regard.....
推荐答案
尝试使用此
<tr>
<td colspan="4">
<s:iterator value="importFiles" status="importFilesCount">
<input type="radio" name="mifFile" value="<s:property />"><s:property /><br>
</s:iterator>
</td>
</tr>
它将垂直排列您的广播列表.
It will arrange your radiolist vertically.
这篇关于为struts 2中的字符串列表制作单选按钮的垂直列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!