<%-- 
/**
  * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  * USA
  *
  * Component of: Red Hat Application Server
  * 
  * Initial Developers: Aizaz Ahmed
  *                     Vivek Lakshmanan
  *                     Andrew Overholt
  *                     Matthew Wringe
  * Developers: Greg Lapouchnian
  * 			Patrick Smith
  */
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>

<jsp:include page="common/header.jsp" />

    <!-- Content begins here -->

    <div id="form">

    <jsp:include page="messages.jsp" />

    <!-- Include the form itself -->
    <form class="createForm" action="<c:url value="/admin/createType.do"/>" method="post">
    
    <div class="formheader">
        <span>Edit or Create an Item</span>
    </div>


	    New Type: 
	    <spring:bind path="command.name">
	    	<input name="name" value="<c:out value="${status.value}"/>" size="20" maxlength="20"/> <br>
	    	<span class="error"><c:out value="${status.errorMessage}"/></span>
	   	</spring:bind>
	   	
	    <br />
	    <div class="formHeader">Associate Properties</div>
	
	    <div class="typeProps">
	        <table class="fields">
   	            <tr class="header">
	                <td></td>
	                <td class="bodyText" >Property Name</td>
	            </tr>
	   			<c:forEach items="${command.properties}" var="prop" varStatus="loopStatus">
		            <tr>
		                <td class="bodyText" ><c:out value="${loopStatus.index+1}"/></td>
		                <td>
   							<spring:bind path="command.properties[${loopStatus.index}].name">
							<input type="text" name="<c:out value="${status.expression}"/>" value="<%= status.getDisplayValue() %>">
					    	<span class="error"><c:out value="${status.errorMessage}"/></span>							
							</spring:bind>
						</td>
		            </tr>
				</c:forEach>   
	        </table>

			<input type="submit" name="add-property" value="Add a Property"> - 	
			<input type="submit" name="save-type" value="Add Type">

						
	   		<div class="spacer"></div>
	    </div>                                                                                                     

    </form>

    <!-- This is necessary to force the parent to expand and include floating divs -->
    <br style="clear:both">
</div>

<jsp:include page="common/footer.jsp" />
