Edit C:\galaxie\Back\galaxie\netbusiness\emailing\select_multiple.jsp
<%@ page language="java"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="java.util.Vector" %> <%@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); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String field = flRequest.getParameter("field"); String multivalSeparator = flRequest.getParameter("multivalSeparator"); if (multivalSeparator == null || "".equals(multivalSeparator)) { multivalSeparator = "|"; } String formIndex = flRequest.getParameter("formIndex"); try { Integer.parseInt(formIndex); } catch (NumberFormatException nfe) { formIndex = "0"; } formIndex = formIndex != null && !"".equals(formIndex) ? formIndex : "0"; Vector ids = (Vector)flRequest.getAttribute("ids"); if (ids == null) { ids = new Vector(); } Vector types = (Vector)flRequest.getAttribute("types"); if (types == null) { types = new Vector(); } Vector displays = (Vector)flRequest.getAttribute("displays"); if (displays == null) { displays = new Vector(); } %><html> <head> <link rel="stylesheet" type="text/css" href="<fl:link url="/css/grid/edeal_grid_css.jsp"/>"> <link rel="stylesheet" type="text/css" href="<fl:link url="/common/select/select_css.jsp"/>"> <link rel="stylesheet" type="text/css" href="<fl:link url="/css/common_css.jsp"/>"> <script type="text/javascript" src="<fl:link url="/js/edeal/libraries/jquery/jquery.js"/>"></script > <script type="text/javascript" src="<fl:link url="/js/ajax/ajax.js"/>"></script> <script type="text/javascript" src="<fl:link url="/js/utils.js"/>"></script> <script type="text/javascript" language="javascript"> var vectID = new FlVector(); var vectDisp = new FlVector(); var vectType = new FlVector(); var selectedID = new FlVector(); var selectedDisplay = new FlVector(); function closeWindow() { setTimeout(finalCloseWindow, 10); } function finalCloseWindow() { window.top.close(); } function doAddEntry(pEntID, pPerID, pDisp,pType) { if(!pEntID && !pPerID) return; if(!pEntID) pEntID = ''; if(!pPerID) pPerID = ''; var id = pPerID ; if(!vectID.contains(id)) { vectID.addElement(id); vectDisp.addElement(pDisp); vectType.addElement(pType); addRowToResultGrid(id,pDisp); } } function addRowToResultGrid(id, display) { var rowStr = '<tr id=\"tableRow_' + id.replace(":","") + '\" class=\"' + (vectID.size() % 2 == 0 ? 'odd' : 'even') + '\"><td>'; rowStr += '<a href=\"javascript:unselect(\'' + id + '\')\"><img src=\"<fl:link url="/icons/ico/close.gif"/>\" class=\"unselect_button\"></a>'; rowStr += '</td><td>' + display + '</td></tr>'; var lastID = vectID.elementAt(vectID.size() - 1); if (lastID == id) { lastID = vectID.elementAt(vectID.size() - 2); } if (lastID) { $('#tableRow_' + lastID.replace(":","")).after(rowStr); } else { $("#_grid__result_div_").html(""); $("#_grid__result_div_").after("<table>"+rowStr+"</table>"); } } function refreshRowClasses() { var doEven = true; for (var idx = 0; idx < selectedID.size(); idx++) { var jQueryVar = $('#tableRow_' + selectedID.elementAt(idx)); jQueryVar.addClass(doEven ? 'even' : 'odd'); jQueryVar.removeClass(!doEven ? 'even' : 'odd'); doEven = !doEven; } } function unselect(id) { var pos = -1; for (var i = 0; i < vectID.size(); i++) { if (vectID.elementAt(i) == id) { pos = i; } } if (pos == -1) { return; } vectID.removeElementAt(pos); vectDisp.removeElementAt(pos); vectType.removeElementAt(pos); // suppression de la ligne numerote pos dans myData_result myData_result = removeFrom(myData_result, pos); if (!myData_result) { myData_result = new Array(); } myGrid_result.setRowCount(vectID.size()); myGrid_result.refresh(); } function removeFrom(tab, pos) { if (!tab) { return; } var tmp = new Array(); var nbElements = tab.length; for (var i = 0; i < nbElements; i++) { if (i < pos) { tmp[i] = tab[i]; } else if (i > pos) { tmp[i - 1] = tab[i]; } } return tmp; } function validate() { var strURL = '<fl:webapp/>/select_emagroup_valid.fl?field=<%= field %>&formIndex=<%= formIndex %>&ids=' + vectID.toString('<%= multivalSeparator %>') + '&types=' + vectType.toString('<%= multivalSeparator %>') + '&multivalSeparator=' + encodeURIComponent('<%= multivalSeparator %>'); doAjax(strURL); } function doSubmit(f) { var strURL = '<fl:webapp/>/select_emagroup_list.fl?type=' + encodeURIComponent(f.type.options[f.type.selectedIndex].value) + '&query=' + encodeURIComponent(f.query.value + '%') + '&criteria=' + encodeURIComponent(f.criteria.value); var entity_type=f.type.value; if (entity_type=="person" || entity_type=="journalist") { window["_grid__select_indiv_js_"].callAjaxForHtml(strURL); } else { window["_grid__select_group_js_"].callAjaxForHtml(strURL) } } function changeCriteria(form, type) { if (type =="enterprise") { form.criteria.value = "EntCorpName"; } else if (type == "person") { form.criteria.value = "PerName"; } else if (type == "Silhouette") { form.criteria.value = "SilName"; } //alert(form.criteria.value); } function doSelectIndiv(groupID, type) { var strURL = '<fl:webapp/>/select_emagroup_list.fl?type='; if (type == 'Silhouette') { strURL += 'Silhouette&criteria=SilID'; } else { strURL += 'person&criteria=PerEntID'; } strURL += '&query=' + encodeURIComponent(groupID); window["_grid__select_indiv_js_"].callAjaxForHtml(strURL); } function doOnload() { <% String id=""; String label=""; String type=""; for (int i = 0 ; i < ids.size(); i++) { id=(String)ids.elementAt(i); type=(String)types.elementAt(i); label=(String)displays.elementAt(i); %>vectID.addElement('<%= Utils.formatToJavascript(id) %>'); vectType.addElement('<%= Utils.formatToJavascript(type) %>'); vectDisp.addElement('<%= Utils.formatToJavascript(label) %>'); _grid__result_js_.addColumn(new Array(escape('javascript:unselect(\'<%=id%>\')'), escape('<img src=\\\"<fl:link url="/icons/ico/close.gif"/>\\\" class=\\\"unselect_button\\\">'), "<%=label%>", "<%=id%>")); <% } %> _grid__result_js_.setAjaxUrl('<fl:webapp/>/select_clientsidelist_ajax.fl'); _grid__result_js_.renderLocal(); document.forms[0].query.focus(); } function doOnload_ultiple() { var win = window.top.opener; var f = win.document.forms[<%= formIndex %>]; var mvlSeparator = f.elements['$$multivalSeparator'] ? f.elements['$$multivalSeparator'].value : '|'; var strIds = f.<%= field %>.value; var idsArray = strIds.split(mvlSeparator); if (strIds != '') { selectedID = new FlVector(idsArray); var lblField = f.lbl<%= field %>; for (var i = 0; i < lblField.options.length; i++) { selectedDisplay.addElement(lblField.options[i].text); _grid__result_js_.addColumn(new Array(escape('javascript:unselect(\'' + idsArray[i] + '\')'), escape('<img src=\\\"<fl:link url="/icons/ico/close.gif"/>\\\" class=\\\"unselect_button\\\">'), escape(lblField.options[i].text), idsArray[i])); } } _grid__result_js_.setAjaxUrl('<fl:webapp/>/select_clientsidelist_ajax.fl'); _grid__result_js_.renderLocal(); document.forms[0].query1.focus(); } </script> </head> <body onload="doOnload()"> <div style="width: 750px"> <table class="global" cellpadding="0"> <tr> <td class="header_top_left"></td> <td class="header_top_middle" style="width: 343px"></td> <td class="header_top_right"></td> <td class="header_top_left"></td> <td class="header_top_middle" style="width: 343px"></td> <td class="header_top_right"></td> </tr> <tr> <td class="header_center_left"></td> <td class="header_center_middle title"> <form action="javascript:doSubmit(window.document.forms[0])"> <div style="display: inline"> <div class="criteria"> <input type="hidden" name="criteria" id="criteria" value="EntCorpName"> <span class="criteria_field"> <select id="type" name="type" onchange="changeCriteria(this.form, this.options[this.selectedIndex].value);"> <option value="enterprise"><fl:getMessage code="F002B" alt="Entreprise"/></option> </select> </span> <span class="criteria_field"><input id="query" name="query" type="text" size="20" value=""></span> </div> </div> <input type="image" src="<fl:link url="/icons/ico/valid_green2_long.gif"/>" class="search_button_new"> </form> </td> <td class="header_center_right"></td> <td class="header_center_left"></td> <td class="header_center_middle title"> <form action="javascript:doSubmit(window.document.forms[1])"> <div style="display: inline"> <div class="criteria"> <input type="hidden" name="criteria" id="criteria" value="PerName"> <span class="criteria_field"> <select id="type" name="type" onchange="changeCriteria(this.form, this.options[this.selectedIndex].value);"> <option value="person"><fl:getMessage code="F002E" alt="Personne"/></option> <option value="Silhouette"><fl:getMessage code="F002F" alt="Silhouette"/></option> </select> </span> <span class="criteria_field"><input id="query" name="query" type="text" size="20" value=""></span> </div> </div> <input type="image" src="<fl:link url="/icons/ico/valid_green2_long.gif"/>" class="search_button_new"> </form> </td> <td class="header_center_right"></td> </tr> <tr> <td class="header_bottom_left"></td> <td class="header_bottom_middle"></td> <td class="header_bottom_right"></td> <td class="header_bottom_left"></td> <td class="header_bottom_middle"></td> <td class="header_bottom_right"></td> </tr> <tr style="height: 250px"> <td class="body_left"></td> <td class="body_middle"><div> <fl:grid name="select_group" width="100%" height="250px"></fl:grid></div></td> <td class="body_right"></td> <td class="body_left"></td> <td class="body_middle"><div> <fl:grid name="select_indiv" width="100%" height="250px"></fl:grid></div></td> <td class="body_right"></td> </tr> <tr> <td class="body_bottom_left"></td> <td class="body_bottom_middle"><img src="<fl:link url="/icons/popup/pop14.gif"/>" width="9" height="18"></td> <td class="body_bottom_right"></td> <td class="body_bottom_left"></td> <td class="body_bottom_middle"><img src="<fl:link url="/icons/popup/pop14.gif"/>" width="9" height="18"></td> <td class="body_bottom_right"></td> </tr> </table> <table class="global"> <tr> <td class="separation" colspan="3"></td> </tr> <tr> <td class="selection_title_left"></td> <td class="selection_title_middle title"><fl:getMessage code="L63DF" alt="Votre séléction"/></td> <td class="selection_title_right"></td> </tr> <tr> <td class="selection_body_left"></td> <td class="selection_body_middle"><fl:grid name="result" height="140px" hidePage="true"/></td> <td class="selection_body_right"></td> </tr> <tr> <td class="selection_bottom_left"></td> <td class="selection_bottom_middle"></td> <td class="selection_bottom_right"></td> </tr> </table> <div class="validation"><a href="javascript:validate()"><img src="<fl:link url="/icons/ico/valid_green_long.gif"/>" class="valid_button_new"></a> <a href="javascript:closeWindow();"><img src="<fl:link url="/icons/ico/fermer_red_long.gif"/>" class="cancel_button_new"></a></div> </div> <div id="waiting" style="display:none"><fl:getMessage code="L639B" alt="Chargement ..."/></div> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de