Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\common\list\listAjax_full.jsp
<%@page import="com.edeal.frontline.grid.GridData.GridCellContent"%> <%@ page language="java" contentType="text/plain;charset=UTF-8"%> <%@page import="java.util.Enumeration"%> <%@page import="com.edeal.frontline.helper.ActorBaseHelper"%> <%@page import="com.edeal.frontline.helper.custom.ActorHelper"%><% /****************************************************************************** * Copyright (c) 2000-2005 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. ******************************************************************************/ // Please note! If you change this file in any way, please make the same changes to any // JSP file containing the following string: //**listAjax.jsp**// %><%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.grid.*" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="com.edeal.frontline.grid.EdealGrid" %> <%@ page import="java.util.*" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="com.edeal.frontline.navigation.EdealBigTabsNavigation" %> <%@ page import="com.edeal.frontline.navigation.EdealBigTabsNavigation.BigTabsParams" %> <%@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 code = flRequest.getRequestParameterOrAttribute("gridName"); if (code == null) { String paramCode = flRequest.getRequestParameterOrAttribute("code"); code = flRequest.getRequestParameterOrAttribute(paramCode + "_gridName"); if (code == null) { code = paramCode; } } GridData grid = (GridData)flRequest.getAttribute(code); boolean isEmbedded = flRequest.getAttribute(code + "_Embedded") != null; boolean isEmbedded2 = grid.isEmbedded(); String type = (String)flRequest.getAttribute("objSql"); if (type==null) { type=(String)flRequest.getAttribute(code+"_objSql"); } FlContext context = flRequest.getContext(); EdealBigTabsNavigation bTabNav = new EdealBigTabsNavigation(flRequest); bTabNav.setBigTabsParameterValue(BigTabsParams.SelectedTab, "1"); DataDictionary dico = context.getDataDictionary(); String pEditMode=flRequest.getParameter("editmode"); boolean fUpdateMode=("true".equals(pEditMode)); String pAllowUserUpdate=flRequest.getParameter("allowupdate"); boolean fAllowUpdate=("true".equals(pAllowUserUpdate)); EdealGrid edealGrid=new EdealGrid(); edealGrid.setName(code); edealGrid.buildColumns(session, context, grid); //boolean fAllowUpdate=true; //boolean fUpdateMode=false; int totalNbOfRecs=grid.getTotalNbOfRecords(); boolean fDisplayCounter=(totalNbOfRecs!=0); int pageNumber=grid.getPageNumber()+1; fAllowUpdate=fAllowUpdate && grid.isUpdatable(); String jsGridObject=bTabNav.getBigTabsParameterValue(BigTabsParams.NameSearchGridJs); String[] updColumnFields=grid.getColumnUpdFld(); boolean canUpdateList=((updColumnFields!=null) && (updColumnFields.length>0)); // can we mass select entries ? boolean isMassSelect=grid.isMassSelectable(); if(grid.getNbRows()==0){ %> <fl:label code="L0001" label="Aucune entrée disponible "/> <%}else{ %> <div class="grid-actions"> <% int totalNbOfPages=(totalNbOfRecs/grid.getNbRows())+1; if(!(grid.isFirstPage() && grid.isLastPage())){%> <div id="pagination" class="dataLabel grid-actions-item"> <%if(!grid.isFirstPage()){%> <a onclick="<%=jsGridObject%>.loadPage('<%=grid.getPageNumber()-1%>',$('input.btMassEdit:checked').length>0);return false;" href="#"> <img src="<fl:webapp/>/icons/ico/flecheG.gif"/> </a> <%} if (fDisplayCounter) {%> <%=Utils.getMessage(session, "F608C", "Page")%> <%=pageNumber+"/"+totalNbOfPages%><%= " - ("+totalNbOfRecs+")"%> <%} if(!grid.isLastPage()){%> <a onclick="<%=jsGridObject%>.loadPage('<%=grid.getPageNumber()+1%>',$('input.btMassEdit:checked').length>0);return false;" href="#"> <img src="<fl:webapp/>/icons/ico/flecheD.gif"/> </a> <%}%> </div> <%}%> <% if (fAllowUpdate && !fUpdateMode) {%> <div class="grid-actions-item"> <ul > <li class="actions_tablecell_1 actions_tabletext" ><a href="javascript:<%= jsGridObject %>.reloadForEdition()"><fl:getMessage code="A0008" alt="Modifier"/></a></li> </ul> </div> <% } %> <% if (fUpdateMode) {%> <div class="grid-actions-item"> <ul> <li class="actions_tablecell_1 actions_tabletext"><a href="javascript:<%= edealGrid.getJsGridName()%>.save()"><fl:getMessage code="A0003" alt="Enregistrer"/></a></li> <li class="actions_tablecell_1 actions_tabletext"><a href="javascript:<%= jsGridObject %>.reset()"><fl:getMessage code="A2002" alt="Annuler"/></a></li> </ul> </div> <% } %> </div> <div id="grid-data" class="data"> <table > <thead> <tr> <% if (isMassSelect) { %> <th><input type="checkbox"></th> <% } %> <% int formIndex=1; for (EdealGridColumn gridColumn: edealGrid.getColumns()) { if (!gridColumn.getDataType().equals(EdealGridColumn.DataType.PREVIEW)) { %> <%=gridColumn.getHeader(edealGrid.getJsGridName(), edealGrid.getName(), flRequest)%> <%} } %></tr> </thead> <tbody><% ArrayList<String> rowsId = grid.getRowsId(); ArrayList<String> previewValue = new ArrayList(); boolean oddRow = false; ActorBean currentActor=ActorHelper.getSessionActor(session); BasicBean rowBean; for(int rowidx = 0; rowidx < grid.getData().length; rowidx++) { String id = ""; oddRow = !oddRow ; String objectID=""; if (rowsId != null && rowsId.size()>0 && rowsId.get(rowidx) != null) { objectID=rowsId.get(rowidx); id = " id=\"" + objectID + "\""; }%> <tr<%= id %> class="<%= (oddRow ? "even" : "odd") %> bean" tabindex="<%=rowidx%>"> <% if (isMassSelect) { %> <td><input type="checkbox" onclick="<%=jsGridObject%>.addMassSelect('<%=objectID%>',this.checked)"></td> <% } %> <% Object[] row = grid.getData()[rowidx]; for (int colidx = 0; colidx < row.length; colidx++) { EdealGridColumn eGCol = edealGrid.getColumn(colidx); if(eGCol.getDataType().equals(EdealGridColumn.DataType.PREVIEW)){ previewValue.add((String)row[colidx]); } else { %> <td> <% boolean allowedToEdit=fUpdateMode && canUpdateList && updColumnFields[colidx]!=null; if (allowedToEdit) { try { rowBean= dico.getTable("sql",type).getBasicBean(objectID,session); allowedToEdit=rowBean.enforceAccess(AccessControlManager.EDIT,currentActor); if (allowedToEdit) { request.setAttribute(type,rowBean); } } catch (FrontlineException e) { logger.error("listAjax.jsp: cannot load bean ["+type+"]["+objectID+"]",e); } } if (allowedToEdit) { String fieldsToBeUpdated=updColumnFields[colidx]; Vector<String> vFieldsToBeUpdated=(Vector<String>)Utils.explodeList(fieldsToBeUpdated,";"); Enumeration<String> enumFieldsToBeUpdated=vFieldsToBeUpdated.elements(); %> <div class="editField"> <table><tr> <% while (enumFieldsToBeUpdated.hasMoreElements()) { String fieldName=enumFieldsToBeUpdated.nextElement(); %> <td> <fl:input property="<%= fieldName %>" id="<%= fieldName + \"-\" + objectID %>"/> </td> <% formIndex++; } %> </tr></table> </div> <% } else { %> <div class="readField"> <%= eGCol.format((GridCellContent)row[colidx]) %> </div> <% } %> </td> <% }} request.removeAttribute(type); %> </tr> <% } %></tbody> </table> </div> <%for(int i=0; i<previewValue.size(); i++){%> <div id="preview-<%=rowsId.get(i)%>" class="preview" style="display:none"> <table class="container"> <tr> <td width="15px"> <img src="<fl:link url="/icons/loupesmall.gif"/>"> </td> <td class="separation"> <div class="separation"/> </td> <td><%=previewValue.get(i)%></td> </tr> </table> </div> <%} }%>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de