Skip to content
Snippets Groups Projects
Commit 40f6233b authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Fix RadioButtons disappearing on popup load

Fix RadioButtons disappearing on popup load
parent e20ea256
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,15 @@ ...@@ -77,6 +77,15 @@
</thead> </thead>
<spring:eval var="radioId" expression="1" /> <spring:eval var="radioId" expression="1" />
<c:set var="control" value="true" /> <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"> <c:forEach items="${data}" var="item">
<tr> <tr>
<c:set var="itemId"><spring:eval expression="item.${typeIdFieldName}"/></c:set> <c:set var="itemId"><spring:eval expression="item.${typeIdFieldName}"/></c:set>
...@@ -84,16 +93,12 @@ ...@@ -84,16 +93,12 @@
<c:choose> <c:choose>
<c:when test="${select}"> <c:when test="${select}">
<input type="checkbox" id="${radioId}" name="radioButton" value="${itemId}"/> <input type="checkbox" id="tmp_${radioId}" name="radioButton" value="${itemId}"/>
<script type="text/javascript"> <script type="text/javascript">updateRadioButton('CheckBox',${radioId});</script>
Spring.addDecoration(new Spring.ElementDecoration({elementId : '${radioId}', widgetType: 'dijit.form.CheckBox', widgetAttrs : {}}));
</script>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<input type="radio" id="${radioId}" name="radioButton" value="${itemId}"/> <input type="radio" id="tmp_${radioId}" name="radioButton" value="${itemId}"/>
<script type="text/javascript"> <script type="text/javascript">updateRadioButton('RadioButton',${radioId});</script>
Spring.addDecoration(new Spring.ElementDecoration({elementId : '${radioId}', widgetType: 'dijit.form.RadioButton', widgetAttrs : {}}));
</script>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
...@@ -271,9 +276,11 @@ ...@@ -271,9 +276,11 @@
<c:if test="${not empty maxPages}"> <c:if test="${not empty maxPages}">
<util:pagination maxPages="${maxPages}" page="${param.page}" size="${param.size}" /> <util:pagination maxPages="${maxPages}" page="${param.page}" size="${param.size}" />
</c:if> </c:if>
<c:set var="create" scope="session" value="true" />
</td> </td>
</tr> </tr>
<c:set var="create" scope="session" value="true" />
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment