<%@ page language="java" contentType="text/plain;charset=UTF-8"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.Utils" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); String id = flRequest.getRequestParameterOrAttribute("id"); %> var appropriateBehavior = true; var f = document.forms[0]; if (typeof f == "undefined") appropriateBehavior = false; var monSelect = f.ListeAttachements; if (typeof monSelect == "undefined") appropriateBehavior = false; if (appropriateBehavior) { var index = -1; for (var i = 0; i < monSelect.options.length; i++) { if (monSelect.options[i].value == '<%= id %>') { index = i; } } for (var i = 0; i < monSelect.options.length; i++) { if (i >= index && i < (monSelect.options.length - 1)) { monSelect.options[i] = monSelect.options[i + 1]; } else if (i == (monSelect.options.length - 1)) { monSelect.options[i] = null; } } monSelect.options[monSelect.options.length] = null; if (!monSelect.options || monSelect.options.length == 0) { monSelect.options[0] = new Option('', 'VIDE'); } var multivalSeparator = f.$$multivalSeparator.value; var idsArray = f.initAttID.value.split(multivalSeparator); var namesArray = f.initAttFileName.value.split(multivalSeparator); var newID = new Array(); var newNames = new Array(); for (var i = 0; i < idsArray.length; i++) { if (i < index) { newID[i] = idsArray[i]; newNames[i] = namesArray[i]; } else if (i > index) { newID[i - 1] = idsArray[i]; newNames[i] = namesArray[i]; } } f.initAttID.value = newID.join(multivalSeparator); f.initAttFileName.value = newNames.join(multivalSeparator); }