问题描述
我有一个枚举类 RadioButtonEnum,我在其中初始化所有单选按钮名称。 I just added Button 4
,and when this is selected,I want a text field to be populated with a default value of 20 and label next to it as "seconds".我很难做到这一点。 This is what I have so far which populates all the radio buttons,and when any of these radio button is selected,a function is called to populate some items in a drop down menu:
<tr class= "even">
<td align="left">
<div class="field">
<g:each in="${RadioButtonEnum.getAllEnumList()}" var="commandItem"> //gets the radiobuttons from enum
<input type="radio" name="compAction"
value="${commandItem.key}" <g: if test="${commandItem.key==command}"> checked </g:if>
onclick="function1()">
${commandItem}<br>
</g:each>
</div>
</td>
<td align="left" style="padding-right: 60px; ">
<div class="field">
<g:set var="compName" value="" />
<select multiple id="ComponentsId" name="ComponentId" class="dropdown" size="5">
<g:each in="${componentList} var="item">
<option vale="$item[1]} " >${item[0]}</option>
</g:each>
<select>
</div>
</td>
枚举类定义了以下单选按钮:
enum RadioButtonEum {
BUTTON1('Button1'),BUTTON2('Button2'),BUTTON3('Button3'),
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)