Dictionary/webroot/jsp/spellingForm.jsf

60 lines
2.1 KiB
Text

<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" %>
<%-- <%@ page import="java.util.HashMap" %> --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!--spellingForm.jsf-->
<c:out value='<a name="${ component }" ></a>' escapeXml="false" />
<c:choose>
<c:when test="${ ! empty param.formMode && param.formMode == 'insert'}">
<c:set var="updateMode" value="${ false }" />
<c:set var="newCmd" value="insert" />
<c:set var="spelling" value="" />
<c:set var="spellingType" value="0" />
<c:set var="metaId" value="" />
</c:when>
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
<c:set var="updateMode" value="${ true }" />
<c:set var="newCmd" value="update" />
<c:set var="spelling" value="${ component.spelling }" />
<c:set var="spellingType" value="${ component.spellingType }" />
<c:set var="metaId" value="${ component.metaId }" />
</c:when>
<c:otherwise>
<c:set var="updateMode" value="${ false }" />
<c:set var="newCmd" value="" />
<c:set var="spelling" value="ERROR" />
<c:set var="spellingType" value="ERROR" />
<c:set var="metaId" value="ERROR" />
</c:otherwise>
</c:choose>
<form id="newCompForm" action="/lex/action" method="post">
<p>
<input type="hidden" name="comp" value="spelling" />
<c:if test="${ updateMode }">
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
</c:if>
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
Spelling: <br />
<textarea name="spelling" rows="8" cols="90"><c:out value='${ spelling }' escapeXml='false' /></textarea>
<br />
Spelling Type:
<select name="spellingType">
<c:forEach var="varTypes" items="${ applicationScope.flatData.spellingTypes }" >
<c:set var="sel" value="" />
<c:if test="${ varTypes.key == spellingType }">
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='${ varTypes.key }' ${sel}>${ varTypes.value }</option>" escapeXml="false" /> <br />
</c:forEach>
</select>
<br />
<jsp:include page="metaForm.jsf" />
<input type="submit" value="Submit Spelling" />
</p>
</form>