%
/******************************************************************************
* 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 language="java" contentType="text/plain;charset=UTF-8"%>
<%@ page import="com.edeal.frontline.navigation.FlRequest" %>
<%@ page import="com.edeal.frontline.grid.*" %>
<%@ page import="com.edeal.frontline.FrontlineException" %>
<%@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;
int nbOfCols=grid.getNbColumns();
String[] titles=grid.getColumnTitles();
%>
try {
var _doHidePage = false;
try {
_doHidePage = <%= code %>_hidePage;
} catch (error) {
}
try {
if (<%= code %>_nbRows == 0) {
<%= code %>_nbRows = <%= grid.getNbRows() %>;
}
} catch (error) {
}
<% if (isEmbedded) { %>
try {
window.document.getElementById('<%= code %>_pagDiv').style.display = '<%= grid.isFirstPage() && grid.isLastPage() ? "none" : "block" %>';
} catch (error) {
}
<% } %>
if (!_doHidePage) {
<% if (grid != null) {
if (grid.isFirstPage()) {
%>
window.document.getElementById("<%= code %>_previous").style.visibility = "hidden";
<%
} else {
%>
window.document.getElementById("<%= code %>_previous").style.visibility = "visible";
<%
}
if (grid.isLastPage()) {
%>
window.document.getElementById("<%= code %>_next").style.visibility = "hidden";
<%
} else {
%>
window.document.getElementById("<%= code %>_next").style.visibility = "visible";
<%
}
%>
window.<%= code %>_page = <%= grid.getPageNumber() %>;
var node = window.document.getElementById("<%= code %>_nbpage");
while ( node.hasChildNodes() ) {
node.removeChild(node.firstChild);
}
node.appendChild(window.document.createTextNode(' ' + (window.<%= code %>_page + 1)));
} // end hidePage
myGrid_<%= code %>.setRowCount(<%= grid.getNbRows() %>);
try {
emptyGridStrings['<%= code %>'] = '';
} catch (error) {
}
<%
String ajaxScript;
try {
ajaxScript = GridTag.printAjaxGridData(grid, code, session);
} catch (FrontlineException e) {
ajaxScript = "";
logger.error("[listAjax.jsp] - " + e.toString());
}
%><%= ajaxScript %><%
} %>
} catch (error) {
alert(error);
}