<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root	xmlns:jsp="http://java.sun.com/JSP/Page" 
				xmlns:c="http://java.sun.com/jsp/jstl/core" 
				xmlns:fe="http://www.emdt.ardeo.net/jsp/fe"
				xmlns:bean="http://jakarta.apache.org/struts/tags-bean"
				xmlns:webapp="http://www.emdt.ardeo.net/jsp/webapp"
				version="2.0">
	<jsp:directive.page contentType="text/html" />
	<fe:formElement var="fe" element="${currentElement}"/>
	<c:set var="fd" value="${xmlFormCtx.fieldDataMap[fe.id]}"/>
	<fe:forEach var="item" element="${currentElement}">
		<c:choose>
			<c:when test="${item.tagName == 'item'}">
				<fe:formElement var="option" element="${item}"/>
				<webapp:input id="${fe.id}" name="${fe.id}" type="radio" value="${option.value}" checked="${option.value == xmlFormCtx.data[fe.id] ? 'checked' : ''}"/>
				<c:out value="${option.label }"/><br/>
			</c:when>
			<c:when test="${item.tagName == 'named-list'}">
				<fe:getAttribute var="nlName" element="${item}" attribute="name" />
				<fe:getAttribute var="nlDomain" element="${item}" attribute="domain" />
				<webapp:namedList name="${nlName }" domain="${nlDomain }" id="nl"/>
				<c:forEach var="pair" items="${nl.pairs }">
					<webapp:input id="${fe.id}" name="${fe.id}" type="radio" value="${pair.first }" checked="${pair.first == xmlFormCtx.data[fe.id] ? 'checked' : ''}"/>
					<c:out value="${pair.second }"/><br/>
				</c:forEach>
			</c:when>
		</c:choose>
	</fe:forEach>
</jsp:root>