diff --git a/src/main/webapp/WEB-INF/tags/form/fields/table.tagx b/src/main/webapp/WEB-INF/tags/form/fields/table.tagx index 2a807e7c3316f38140bc65aac4f9e52ced24ec3b..1da77c379e21d7ed2ebb5c81c134a1c0dcd13c03 100644 --- a/src/main/webapp/WEB-INF/tags/form/fields/table.tagx +++ b/src/main/webapp/WEB-INF/tags/form/fields/table.tagx @@ -77,6 +77,15 @@ </thead> <spring:eval var="radioId" expression="1" /> <c:set var="control" value="true" /> + + <script type="text/javascript"> + function updateRadioButton(type, id){ + var buttonId = document.getElementsByName("radioButton").length + id; + document.getElementById("tmp_"+id).id=buttonId; + Spring.addDecoration(new Spring.ElementDecoration({elementId : buttonId, widgetType: 'dijit.form.'+type, widgetAttrs : {}})); + } + </script> + <c:forEach items="${data}" var="item"> <tr> <c:set var="itemId"><spring:eval expression="item.${typeIdFieldName}"/></c:set> @@ -84,16 +93,12 @@ <c:choose> <c:when test="${select}"> - <input type="checkbox" id="${radioId}" name="radioButton" value="${itemId}"/> - <script type="text/javascript"> - Spring.addDecoration(new Spring.ElementDecoration({elementId : '${radioId}', widgetType: 'dijit.form.CheckBox', widgetAttrs : {}})); - </script> + <input type="checkbox" id="tmp_${radioId}" name="radioButton" value="${itemId}"/> + <script type="text/javascript">updateRadioButton('CheckBox',${radioId});</script> </c:when> <c:otherwise> - <input type="radio" id="${radioId}" name="radioButton" value="${itemId}"/> - <script type="text/javascript"> - Spring.addDecoration(new Spring.ElementDecoration({elementId : '${radioId}', widgetType: 'dijit.form.RadioButton', widgetAttrs : {}})); - </script> + <input type="radio" id="tmp_${radioId}" name="radioButton" value="${itemId}"/> + <script type="text/javascript">updateRadioButton('RadioButton',${radioId});</script> </c:otherwise> </c:choose> @@ -271,9 +276,11 @@ <c:if test="${not empty maxPages}"> <util:pagination maxPages="${maxPages}" page="${param.page}" size="${param.size}" /> </c:if> - <c:set var="create" scope="session" value="true" /> </td> </tr> + + <c:set var="create" scope="session" value="true" /> + </table> <script type="text/javascript">