<%@ page language="java" contentType="text/plain;charset=UTF-8" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="java.util.LinkedHashMap" %> <%@ page import="java.util.Iterator" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); String field = flRequest.getRequestParameterOrAttribute("field"); String formName = flRequest.getRequestParameterOrAttribute("formName"); if (formName != null) { try { Integer.parseInt(formName); } catch (NumberFormatException nfe) { formName = "'" + formName + "'"; } } else { formName = "0"; } LinkedHashMap evtStatusInsList = (LinkedHashMap)flRequest.getAttribute("EventStatusInsList"); if (evtStatusInsList == null) { evtStatusInsList = new LinkedHashMap(); } %> var f = document.forms[<%= formName %>]; var field = f.<%= field %>; if (field.options) { field.options.length = 0; } <% Iterator iter = evtStatusInsList.keySet().iterator(); while (iter.hasNext()) { String statusID = iter.next(); String statusDisplay = evtStatusInsList.get(statusID); %> field.options[field.options.length] = new Option('<%= Utils.formatToJavascript(statusDisplay) %>', '<%= statusID %>'); <% } %>