<?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}"/>
	<fe:getAttribute var="size" element="${currentElement}" attribute="size" />
	<select id="<c:out value="${fe.id }"/>" name="<c:out value="${fe.id }"/>" size="<c:out value="${size }"/>">
		<fe:forEach var="item" element="${currentElement}">
			<c:choose>
				<c:when test="${item.tagName == 'item'}">
					<fe:formElement var="option" element="${item}"/>
					<webapp:option currentValue="${xmlFormCtx.data[fe.id]}" value="${option.value}">${option.label}</webapp:option>
				</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:option currentValue="${xmlFormCtx.data[fe.id]}" value="${pair.first}">${pair.second}</webapp:option>
					</c:forEach>
				</c:when>
			</c:choose>
		</fe:forEach>	
	</select>
</jsp:root>