Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\netbusiness\emaillink\edit_massemailing_links_list.jsp
<%@page session="true" contentType="text/html; charset=UTF-8" import="com.edeal.frontline.*, java.util.*, com.edeal.frontline.controller.ControllerServlet, java.lang.reflect.Method"%> <%@ page import="com.edeal.frontline.navigation.*" %> <%@ page import="com.edeal.frontline.netbusiness.*,com.edeal.frontline.helper.custom.MessagesHelper" %> <%@ page import="java.net.URLDecoder" %> <%@page import="org.apache.commons.lang.StringUtils"%> <%@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()); boolean fIsDebugMode = false; String strHiddenOrText = fIsDebugMode ? "text" : "hidden"; ArrayList<EmailLink> arrElink = new ArrayList<EmailLink>(); arrElink = (ArrayList<EmailLink>)request.getAttribute("arrElink"); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); if (arrElink.size() > 0) { %> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/tooltip/jquery.qtip-1.0.0-rc3.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/edeal/libraries/json.org/json2/json2.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/netbusiness/emaillink/emaillink.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ac/inputAC_js.jsp"></script> <style type="text/css"> a:link { text-decoration: none; color: #dd3300; font-size: 10pt ; } a:visited { text-decoration: none; color: #dd3300; font-size: 10pt ; } a:hover { text-decoration: underline; color: #dd3300; font-size: 10pt ; } .emaillink { /*overflow-y: auto;*/ } .emaillink div#grid-link { clear: both; /*overflow-x: auto; overflow-y: auto;*/ border: 0px; /*max-height: 100%;*/ height: 100%; width: 100%; position:relative; padding-left: 1px; padding-right: 1px; } .emaillink div#grid-link table thead { border-bottom: 0px; } .emaillink div#grid-link table tbody td { border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; border-right: 1px solid #ddd; } .emaillink div#grid-link table th { border-bottom: 1px solid #ddd; padding: 1px 1px 1px 1px; font-family: Arial, Verdana, sans-serif; font-weight: bold; font-size: 10pt; vertical-align: middle; } .emaillink div#grid-link table th table tr td { border: 0; padding: 1px 1px 1px 1px; font-family: Arial, Verdana, sans-serif; font-weight: bold; font-size: 10pt; color: #84A6AE; vertical-align: middle; } .emaillink div#grid-link table td { border-left: 1px solid #ddd; border-bottom: 1px solid #ddd; border-right: 1px solid #ddd; padding: 1px 1px 1px 1px; valign: middle; } .emaillink div#grid-link table td td { border: 0px; padding: 1px; vertical-align: middle; valign: middle; } .emaillink div#grid-link table td a img { border: none; width: 17px; height: 17px; vertical-align: middle; padding: 1px 1px 1px 1px; } .emaillink input.text { color: #000000 ; background-color: #FAFDFD; font-family: Arial, Verdana, sans-serif; vertical-align: middle; font-size: 12px; border: 1px solid #A3A6AB; padding: 2px 5px; width: 50%; height: 100%; display:inline; } .emaillink select { color: #000000 ; background-color: #FAFDFD; font-family: Arial, Verdana, sans-serif; vertical-align: middle; font-size: 12px; border: 1px solid #A3A6AB; display: inline; padding: 1px 1px; width: 50%; } .emaillink div#grid-link table { border-width:1px; width:100%; border-collapse:collapse; } .emaillink th { color: #84A6AE; text-align: left; font-size:small; } .tabFdBlanc td, .tabFdBleu td { border-right: 1px solid #ccc; padding: 1px 1px 1px 1px; vertical-align: middle; } .tabFdBlanc { font-size: 12px; font-family: Arial,Verdana,sans-serif; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); } .tabFdBleu { font-size: 12px; font-family: Arial,Verdana,sans-serif; color: rgb(0, 0, 0); background-color: rgb(235, 244, 246); } .tabFdBlanc, .tabFdBleu { border: 0px; border-left: 1px solid #ccc; } td div.text { margin-right: 12px; width: auto; } .emaillink div#grid-link table tr { padding-left:0px; border-bottom: 1px solid #ccc; padding: 1px 1px 1px 1px; text-align: left; } .chpsTextObligatoire { background-color:#FDCBCC; } .emaillink div#div-img img { height:30px; width:50px; float: left; } .emaillink div#div-img { min-height:30px; min-width:50px; float: left; valign: center; } </style> <script language="javascript"> //array to store values used for input autocomplete var storePreviousValues=new Array(); function makeVisibleFields(chkbox){ var index = chkbox.id; var fields = new Array("WopRegroupement", "WopNam", "EvtLabel", "statusid", "PopName"); var visibility_field = chkbox.checked ? "visible" : "hidden"; for (i = 0; i < fields.length; i++) { $(":input[id='" + fields[i] + index + "']").css({visibility: visibility_field}); if (!chkbox.checked) $(":input[id='" + fields[i] + index + "']").val(""); } //empty the elements id => we start a new link if (!chkbox.checked) { $("#wopid" + index).val(""); $("#evtid" + index).val(""); $("#popid" + index).val(""); } $("#WopRegroupement" + index + "_icons").css({visibility: visibility_field}); $("#WopNam" + index + "_icons").css({visibility: visibility_field}); $("#EvtLabel" + index + "_icons").css({visibility: visibility_field}); $("#PopName" + index + "_icons").css({visibility: visibility_field}); $("#status_span" + index).css({visibility: visibility_field}); if (chkbox.checked) { if (($("#WopRegroupement" + index).val() == '') && ($("#WopNam" + index).val() == '') && ($("#wopid" + index).val() == '')) { getWebOperationFieldsFromUrl(arrEmailLinks[chkbox.id.substring(1)].url, index); } } } var arrEmailLinks = new Array(); <% try { //Construire les objects javascript correspondant aux objects java for (int k = 1; k <= arrElink.size(); k++) { %> //Créer l'objet EmailLink avec les données fixes : id, url, emailid, text, index, msg var emailLink = new EmailLink("<%= arrElink.get(k - 1).getId() %>", "<%= arrElink.get(k - 1).getUrl() %>", "<%= arrElink.get(k - 1).getEmailid() %>", "<%= arrElink.get(k - 1).getText() %>", "<%= arrElink.get(k - 1).getIndex() %>", "<%= arrElink.get(k - 1).getMsgid() %>"); //Créer les objets : EmailLinkWebop, EmailLinkEvent et EmailLinkPopulation avec des attributs nulls emailLink.initializeEmailLinkObjects(); emailLink.bindTo("elmelnid_<%= k %>"); arrEmailLinks["<%= k %>"] = emailLink; <% } }catch(Exception e){ } %> function getWebOperationFieldsFromUrl(wopurl, index){ if (wopurl != null && wopurl != ''){ $.ajax({ type: "POST", url: '<fl:webapp/>/get_weboperation_fields_from_url.fl?wopUrl=' + wopurl, timeout: 200000, contentType: "application/json;charset=utf-8", dataType: 'json', success: analyseResult }); } function analyseResult(result){ if (result != null){ if (result.wopNam != ''){ $('#WopNam' + index).val(result.wopNam); } if (result.wopReg != ''){ $('#WopRegroupement' + index).val(result.wopReg); } if (result.wopId != ''){ $('#wopid' + index).val(result.wopId); } } } } function validate(){ var success = true; for (k = 1; k < arrEmailLinks.length; k++) { if (($('#_' + k).is(':checked')) && (($('#WopNam_' + k).val() == '') || ($('#WopRegroupement_' + k).val() == ''))){ $('#WopNam_' + k).css({"background-color":"#FDCBCC"}); $('#WopRegroupement_' + k).css({"background-color":"#FDCBCC"}); success = false; } else { $('#WopNam_' + k).css({"background-color":""}); $('#WopRegroupement_' + k).css({"background-color":""}); } } return success; } function saveEmailLinks() { if (!validate()) return; var rtrn = true; var arrForJson = new Array(); for (linkid in arrEmailLinks) { link = arrEmailLinks[linkid]; if (typeof link == 'object') { //Remplir les objets vides EmailLinkWebop, EmailLinkEvent et EmailLinkPopulation à partir des champs link.buildFromUI(); arrForJson.push(link); } } var jsonstr = JSON.stringify(arrForJson); log(null, "json:" + jsonstr); $.ajax({ data: jsonstr, type: "POST", url: "<fl:webapp/>/save_email_links.fl", timeout: 20000, contentType: "application/json;charset=utf-8", dataType: 'json', async: false, success: analyseResponse }); function analyseResponse(jsonResponse) { if (jsonResponse != null && jsonResponse.length > 0){ var message = '<fl:getMessage code="L70A8" alt="Erreur lors de l\\\'enregistrement des liens" js="true"/>' + ' : ' + '\n'; for(i = 1; i <= jsonResponse.length; i++){ message += ' <fl:getMessage code="F7059" alt="Erreur" js="true"/>' + ' ' + i + '\n'; message += ' <fl:getMessage code="L6594" alt="Objet" js="true"/>' + ' : ' + jsonResponse[i - 1].nameObject + '\n'; message += ' <fl:getMessage code="F61E3" alt="ID" js="true"/>' + ' : ' + jsonResponse[i - 1].idObject + '\n'; message += ' <fl:getMessage code="F1023" alt="Type" js="true"/>' + ' : ' + jsonResponse[i - 1].typeError + '\n'; message += ' <fl:getMessage code="L1035" alt="Détail" js="true"/>' + ' : ' + jsonResponse[i - 1].detailError + '\n'; } alert(message); rtrn = false; } } return rtrn; } function getWebOperationFields(field, field_val, index) { //var field_val = $('#' + field + '_' + index).val(); var url_ajax = '<fl:webapp/>/get_weboperation_fields.fl?' + field + '=' + field_val; $.ajax({ type: "POST", url: url_ajax, timeout: 200000, contentType: "application/json;charset=utf-8", dataType: 'json', success: analyseResponse }); function analyseResponse(result) { if (field == "WopRegroupement"){ if (result.wopNam != ''){ $('#WopNam_' + index).val(result.wopNam); } //cas ou on trouve un seul nom correspondant au code de regroupement if (result.wopID != ''){ $('#wopid_' + index).val(result.wopID); } } else if (field == "WopID"){ if (result.wopNam != ''){ $('#WopNam_' + index).val(result.wopNam); } if (result.wopRg != ''){ $('#WopRegroupement_' + index).val(result.wopRg); } //cas ou on trouve un seul nom correspondant au code de regroupement if (result.wopID != ''){ $('#wopid_' + index).val(result.wopID); } } } } function loadStatus(eventID, index_link, status){ if (($('#EvtLabel_' + index_link).val()).length > 0) { isVisibe = true; $('#event_status_' + index_link).attr("style","display: block"); } else { isVisibe = false; $('#event_status_' + index_link).attr("style","display: none"); } if (isVisibe == true) { var ajaxURL = "<fl:webapp/>/get_event_status.fl?eventID=" + eventID + "&statusID=" + status + "&index=" + index_link + "&visibility=" + isVisibe; $.get(ajaxURL, function(data) { $("#status_span_" + index_link).html(data); }); } } function doSelection_wopRegroupement(index_link, wopUrl) { var query_ = ""; var url_ = '<fl:webapp/>/select_field.fl?type=WebOperation&field=WopRegroupement&fieldIndex=' + index_link + '&formIndex=0'; if (wopUrl != null && wopUrl != '') { query_ = "WopURL='" + encodeURIComponent(wopUrl) + "'"; url_ += "&query=" + query_; } var win = void(window.open(url_, 'SelectActor', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=400')); } function doSelection_wopName(index_link, wopUrl) { var query_ = $('#WopRegroupement_' + index_link).val() != "" ? "WopRegroupement='" + $('#WopRegroupement_' + index_link).val() + "'" : ''; var url_ = '<fl:webapp/>/select_field.fl?type=WebOperation&field=WopNam&fieldIndex=' + index_link + '&formIndex=0'; if (wopUrl != null && wopUrl != '') { query_ += ((query_ != "") ? "|" : "") + "WopURL='" + encodeURIComponent(wopUrl) + "'"; url_ += "&query=" + query_; } var win = void(window.open(url_, 'SelectActor', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=400')); } function getQueryURL(url){ var wopQuery = (url != null && url.length > 0) ? "WopURL=\'" + url + "\'" : ""; return wopQuery; } </script> <div class="emaillink"> <div id="grid-link"> <form> <table cellpadding="0" width="100%"> <thead> <tr valign="top"> <th><fl:getMessage code="L7010" alt="Suivi"/></th> <th></th> <th><fl:getMessage code="L6180" alt="Lien"/></th> <th><fl:getMessage code="L70B4" alt="Groupement - Nom"/></th> <th><fl:getMessage code="L7042" alt="Evénement - Statut"/></th> <th><fl:getMessage code="F000C" alt="Population"/></th> </tr> </thead> <tbody> <% int i = 0; for (EmailLink elnk : arrElink) { if((elnk != null)){ i++; %> <tr class="<%= i%2 == 0 ? "tabFdBlanc" : "tabFdBleu" %>" id="elmelnid_<%= i %>"> <td width="1%" align="center"> <input name="_<%= i %>" id="_<%= i %>" type="checkbox" <%= elnk.getId().indexOf("id__") != -1 ? "" : "checked" %> onClick="makeVisibleFields(this);" class="checkbox"/> <input name="emlid_<%= i %>" id="emlid_<%= i %>" value='<%= elnk.getId()%>' type="<%= strHiddenOrText %>" /> </td> <td width="1%" align="center"> <img src="<fl:webapp/>/icons/flags/gif/<%= dico.getRefCode("Lna", "Val", elnk.getLngmsg()).substring(3, 5).toLowerCase() %>.gif" title="<%= dico.getRefDisp("Lna", "Te1", elnk.getLngmsg()) %>" hspace="3"/> </td> <td width="20%"> <% String realText = URLDecoder.decode(elnk.getText(), "UTF-8"); String adaptedText = realText; if (realText.length() > 40){ adaptedText = realText.substring(0, 40); } String urlDecode = URLDecoder.decode(elnk.getUrl(), "UTF-8"); String url = urlDecode; String webOpID = null; try { //following link webOpID = elnk.getWebop().getWopid(); } catch (Exception e) { } if (webOpID != null){ try { //following link url = new WebOperationBean(webOpID, context).getWopUrl(); } catch (Exception e) { // simple link url = urlDecode; } } if (elnk.getHtmlcontent() != null && elnk.getHtmlcontent().indexOf("img") > 0){ %> <div name="<%= elnk.getId() %>" id="div-img"><%= elnk.getHtmlcontent() %></div> <% } else { %> <a id="<%= elnk.getId() %>" href="<%= urlDecode %>" title="<%= realText %>" target="_blank"><%= adaptedText %></a> <% } if (elnk.getHtmlcontent() != null && elnk.getHtmlcontent().indexOf("img") > 0){ %> <script type="text/javascript"> $("[name='<%= elnk.getId() %>']").qtip({ content: '<%= Utils.formatToJavascript(elnk.getHtmlcontent()) %>' }); </script> <% } %> </td> <%-- Web operation --%> <td NOWRAP style="vertical-align: middle" width="25%"> <% String wopid = ""; try { wopid = elnk.getWebop().getWopid(); } catch (Exception e) { } try { WebOperationBean wopBean = new WebOperationBean(wopid, context); flRequest.setAttribute("WebOperation", wopBean); } catch (Exception e) { flRequest.setAttribute("WebOperation", null); } String jsWopNamChangeFn = "doWopNam_" + i + "Change(this)"; String jsWopGrpChangeFn = "doWopRegroupement_" + i + "Change(true)"; String wopInputQuery = StringUtils.isEmpty(url) ? "" : "WopURL=" + Utils.formatToSQL(url); %> <div style="vertical-align: middle;"> <input name="wopid_<%= i %>" id="wopid_<%= i %>" value='<%= wopid %>' type="<%= strHiddenOrText %>" /> <fl:input property="WopRegroupement" id='<%= "WopRegroupement_" + i %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>' nodiv="true" onchange="<%= jsWopGrpChangeFn %>" query='<%= wopInputQuery %>'> <fl:autocompleter table="WebOperation" field="WopRegroupement" caseSensitive="false" maxLimit="20" trigger="1"/> </fl:input> <span id='<%="WopRegroupement_" + i + "_icons"%>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>'> <a href="javascript:$('#WopRegroupement_<%= i %>').val(''); void(doSelection_wopRegroupement('<%= i %>', '<%= url %>'));"> <img title="<fl:getMessage code="A2003" alt="Sélectionner"/>" alt="<fl:getMessage code="A2003" alt="Sélectionner"/>" src="<fl:webapp/>/icons/ico/rechercher.gif"> </a> <a href="javascript: $('#WopRegroupement_<%= i %>').val(''); $('#WopNam_<%= i %>Query__').val(getQueryURL('<%= url %>')); $('#wopid_<%= i %>').val(''); void('');"> <img title="<fl:getMessage code="A3005" alt="Vider le champ"/>" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>" src="<fl:webapp/>/icons/ico/supprimer.gif"> </a> </span> </div> <div style="vertical-align: middle;"> <fl:input property="WopNam" id='<%= "WopNam_" + i %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>' nodiv="true" onchange="<%= jsWopNamChangeFn %>" query='<%= wopInputQuery %>'> <fl:autocompleter table="WebOperation" field="WopNam" caseSensitive="false" maxLimit="20" trigger="1" distinct="false"/> </fl:input> <span id='<%= "WopNam_" + i + "_icons" %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>'> <a href="javascript: $('#WopNam_<%= i %>').val(''); $('#wopid_<%= i %>').val(''); void(doSelection_wopName('<%= i %>', '<%= url %>'));"> <img title="<fl:getMessage code="A2003" alt="Sélectionner"/>" alt="<fl:getMessage code="A2003" alt="Sélectionner"/>" src="<fl:webapp/>/icons/ico/rechercher.gif"> </a> <a href="javascript: $('#WopNam_<%= i %>').val(''); $('#wopid_<%= i %>').val(''); void('');"> <img title="<fl:getMessage code="A3005" alt="Vider le champ"/>" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>" src="<fl:webapp/>/icons/ico/supprimer.gif"> </a> </span> <script type="text/javascript"> function doWopRegroupement_<%= i %>Change(fromManualChange) { var fManualChange = (fromManualChange == true); var wopNameQuery = "<%= url != null && url.length() > 0 ? "WopURL=\'" + url + "\'" : "" %>" ; if ($('#WopRegroupement_<%= i %>').val() != ''){ if (wopNameQuery != "") { wopNameQuery += '|'; } wopNameQuery += 'WopRegroupement=\'' + $('#WopRegroupement_<%= i %>').val() + '\''; } if (fManualChange) { $('#wopid_<%= i %>').val(''); $('#WopNam_<%= i %>Query__').val(wopNameQuery); } else { getWebOperationFields('WopRegroupement', $('#WopRegroupement_<%= i %>').val(), '<%= i %>'); $('#WopNam_<%= i %>Query__').val(wopNameQuery); } } function doWopNam_<%= i %>Change(element) { if (element != null) { if (element.value == '') { $('#wopid_<%= i %>').val(''); } else { var prevValue=storePreviousValues['wopid_<%= i %>']; if (element.value!=prevValue) { $('#wopid_<%= i %>').val(''); } } storePreviousValues['wopid_<%= i %>']=element.value; } else { getWebOperationFields('WopID', $('#WopNam_<%= i %>Hidden__').val(), '<%= i %>'); storePreviousValues['wopid_<%= i %>']=$('#WopNam_<%= i %>').val(); } } </script> </div> </td> <%-- Event --%> <td NOWRAP style="vertical-align: middle" width="25%"> <% String evtid = ""; String evtstatus = null; try { evtid = elnk.getEvent().getEvtid(); } catch(Exception e) { } try { evtstatus = elnk.getEvent().getStatusid(); } catch(Exception e){ } try { EventBean evtBean = new EventBean(evtid, context); flRequest.setAttribute("Event", evtBean); } catch (Exception e) { flRequest.setAttribute("Event", null); } String jsEvtChangeFn = "doEvtLabel_" + i + "Change(this)"; %> <div style="vertical-align: middle;"> <input name="evtid_<%= i %>" id="evtid_<%= i %>" value='<%= evtid != null ? evtid : "" %>' type="<%= strHiddenOrText %>" /> <fl:input property="EvtLabel" id='<%= "EvtLabel_" + i %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>' nodiv="true" onchange="<%= jsEvtChangeFn %>" > <fl:autocompleter table="Event" field="EvtLabel" caseSensitive="false" maxLimit="20" trigger="1"/> </fl:input> <span id='<%= "EvtLabel_" + i + "_icons" %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>'> <a href="javascript:var query_ = ''; var url_ = '<fl:webapp/>/select_field.fl?type=Event&field=EvtLabel&fieldIndex=<%= i %>&formIndex=0&query='+query_; var win = window.open(url_, 'SelectActor', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=400');"> <img title="<fl:getMessage code="A2003" alt="Sélectionner"/>" alt="<fl:getMessage code="A2003" alt="Sélectionner"/>" src="<fl:webapp/>/icons/ico/rechercher.gif"> </a> <a href="javascript: $('#EvtLabel_<%= i %>').val(''); $('#evtid_<%= i %>').val(''); loadStatus('<%= evtid %>', '<%= i %>', '<%= evtstatus %>'); void('');"> <img title="<fl:getMessage code="A3005" alt="Vider le champ"/>" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>" src="<fl:webapp/>/icons/ico/supprimer.gif"> </a> </span> </div> <div id="event_status_<%= i %>" style="vertical-align: middle;"> <span id="status_span_<%= i %>"> <!-- va contenir un combobox ou un champs text --> </span> <script type="text/javascript"> $("status_span_<%= i %>").ready(function(){ loadStatus('<%= evtid %>', '<%= i %>', '<%= evtstatus %>'); }); $('#EvtLabel_<%= i %>').focusout(function() { loadStatus($('#EvtLabel_<%= i %>Hidden__').val(), '<%= i %>', '<%= evtstatus %>'); }); function doEvtLabel_<%= i %>Change(element) { var evId = $('#EvtLabel_<%= i %>Hidden__').val(); if (element != null) { if (element.value == '') { $('#evtid_<%= i %>').val(''); } else { var prevValue = storePreviousValues['evtid_<%= i %>']; if (element.value != prevValue) { $('#evtid_<%= i %>').val(''); } } storePreviousValues['evtid_<%= i %>'] = element.value; } else { $('#evtid_<%= i %>').val(evId); storePreviousValues['evtid_<%= i %>'] = $('#EvtLabel_<%= i %>').val(); } loadStatus(evId, '<%= i %>', '<%= evtstatus %>'); } </script> </div> </td> <%-- Population --%> <td NOWRAP style="vertical-align: middle" width="25%"> <% String popid = ""; try{ popid = elnk.getPopulation().getPopid(); }catch(Exception e){ } try { PopulationBean popBean = new PopulationBean(popid, context); flRequest.setAttribute("Population", popBean); } catch (Exception e) { flRequest.setAttribute("Population", null); } String jsPopChangeFn = "doPopName_" + i + "Change(this)"; %> <script type="text/javascript"> function doPopName_<%= i %>Change(element){ if (element != null) { if (element.value == "") { $('#popid_<%= i %>').val(''); } else { var prevValue=storePreviousValues['popid_<%= i %>']; if (element.value!=prevValue) { $('#popid_<%= i %>').val(''); } } storePreviousValues['popid_<%= i %>']=element.value; } else { $('#popid_<%= i %>').val($('#PopName_<%= i %>Hidden__').val()); storePreviousValues['popid_<%= i %>']=$('#PopName_<%= i %>').val(); } } </script> <div style="vertical-align: middle;"> <input name="popid_<%= i %>" id="popid_<%=i %>" value="<%= popid != null ? popid : "" %>" type="<%= strHiddenOrText %>" /> <fl:input property="PopName" id='<%= "PopName_" + i %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>' nodiv="true" onchange="<%= jsPopChangeFn %>" query="PopIsPer=1"> <fl:autocompleter table="Population" field="PopName" caseSensitive="false" maxLimit="20" trigger="1"/> </fl:input> <span id='<%= "PopName_" + i + "_icons" %>' style='<%= elnk.getId().indexOf("id__") != -1 ? "visibility:hidden" : "visibility:visible" %>'> <a href="javascript:var query_ = 'PopIsPer=1'; var url_ = '<fl:webapp/>/select_field.fl?type=Population&field=PopName&fieldIndex=<%= i %>&formIndex=0&query='+query_; var win = window.open(url_, 'SelectActor', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=400');"> <img title="<fl:getMessage code="A2003" alt="Sélectionner"/>" alt="<fl:getMessage code="A2003" alt="Sélectionner"/>" src="<fl:webapp/>/icons/ico/rechercher.gif"> </a> <a href="javascript:$('#PopName_<%= i %>').val(''); $('#popid_<%= i %>').val(''); void('');"> <img title="<fl:getMessage code="A3005" alt="Vider le champ"/>" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>" src="<fl:webapp/>/icons/ico/supprimer.gif"> </a> </span> </div> </td> <%}%> </tr> <%}%> </tbody> </table> </form> </div> </div> <% } else { %> <span style="color: #777777; font-size: 11px; font-family : Arial,Verdana,sans-serif;"><fl:getMessage code="L0001" alt="Aucune entrée disponible"/></span> <% } %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de