JavaScript - JQuery Flot me bota No se han encontrado postulantes para el filtro seleccionado. y uncaught except

 
Vista:

JQuery Flot me bota No se han encontrado postulantes para el filtro seleccionado. y uncaught except

Publicado por Fernando Medina (1 intervención) el 17/10/2011 17:47:31
Comando
package edu.ulima.gaad.command;

import edu.ulima.gaad.*;
import edu.ulima.gaad.negocio.IIndicadorMedDifu;
import edu.ulima.gaad.negocio.IndicadorMedDifuManager;
import edu.ulima.ul.MensajeError;

import javax.servlet.*;
import javax.servlet.http.*;

import java.io.*;
import java.util.Vector;


public class ComandoMostrarTipoPgmAcd
extends AbstractControllerCommandGaad
implements ServletConstantsGaad
{

public ComandoMostrarTipoPgmAcd() {
super();
}
/**
* checkParameters method comment.
*/
public boolean checkParameters(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) {
return true;
}
/**
* getErrorMessage method comment.
*/
public String getErrorMessage() {
return null;
}
/**
* getView method comment.
*/
public String getView(int param) {
return "gaad/meddifu/frameTipoPgmAcd.jsp";
}
/**
* getViewError method comment.
*/
public String getViewError(int param) {
return ERROR_JSP;
}
/**
* isRedirect method comment.
*/
public boolean isRedirect() {
return false;
}

public boolean isSegura() {
return false;
}

public java.lang.String RecibirParam(
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String param) {
HttpSession session = request.getSession(false);
return null;
}

public boolean performTask(
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext application) {
try {

IIndicadorMedDifu md = new IndicadorMedDifuManager();
String sFecha = "";
String sTipPgm = "";
int nFecha = 0;

if ((String) request.getParameter("cmbFecha") != null){
sFecha = (String) request.getParameter("cmbFecha");
nFecha = Integer.parseInt(sFecha);
request.setAttribute("prm_sFechaSel", sFecha);
}

if ((String) request.getParameter("cmbTipoPgmAcd") != null){
sTipPgm = (String) request.getParameter("cmbTipoPgmAcd");
request.setAttribute("prm_TipoSel", sTipPgm);
}

if (nFecha != 0 && sTipPgm != ""){
Vector vMedDifu = md.listarMedDifuXFechaXTipoPgmAcd(nFecha, sTipPgm);

request.setAttribute("prm_vectorMedDifu", vMedDifu);
}
Vector vTipPgm = md.listarTipoPgmAcd("140");
request.setAttribute("prm_vectorTipoPgmAcd", vTipPgm);

return true;

} catch (Throwable e) {
request.setAttribute("prm_vectorTipoPgmAcd", null);
request.setAttribute("prm_vectorMedDifu", null);
return false;
}

}
}

JSP


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*"%>

<html>
<head>
<script language="JavaScript" src="../scripts/jquery-1.6.2.min.js"></script>
<script language="JavaScript" src="../scripts/excanvas.min.js"></script>
<script language="JavaScript"
src="../scripts/jquery.flot.hackmultibar.js"></script>
<script language="JavaScript" src="../scripts/jquery.flot.pie.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Software Architect">


<script language="javascript">
function mostrar(){
var obj = document.forms[0];
obj.action = 'ComandoMostrarTipoPgmAcd';
parent.leftWindow.location = obj.action;
obj.submit();

var fechaSel = obj.elements["cmbFecha"].value;
var tipoSel = obj.elements["cmbTipoPgmAcd"].value;
obj.action = 'ComandoMostrarPgmAcd?cmbFecha='+fechaSel+'&cmbTipoPgmAcd='+tipoSel;
parent.rightWindow.location = obj.action;

parent.botWindow.location = 'about:blank';
}

</script>

</head>
<body>
<%
int i;
Vector v = (Vector)request.getAttribute("prm_vectorTipoPgmAcd");
Vector m = (Vector)request.getAttribute("prm_vectorMedDifu");
String prm_sFechaSel = (String)request.getAttribute("prm_sFechaSel");
String prm_sTipoSel = (String)request.getAttribute("prm_TipoSel");

if (prm_sFechaSel == null){
prm_sFechaSel = "0";
}

if (prm_sTipoSel == null){
prm_sTipoSel = "";
}

%>
<form name="frmTipoPgmAcd" action="javascript:mostrar();" method="post">
<%
if (v==null){
String msjErr = "No se ha podido obtener el listado de Tipo de programas académicos.";
%><%=msjErr %>
<%
}else{
%>
<table width="100%">
<tr>
<td><b>Fecha:</b></td>
<td>
<select name="cmbFecha" >
<% java.util.Calendar fecha = java.util.Calendar.getInstance();
for (i=0; i< 5; i++){ %>
<%if (Integer.parseInt(prm_sFechaSel) == (fecha.get(Calendar.YEAR) - i)){ %>
<option selected="selected" value="<%=fecha.get(Calendar.YEAR) - i %>"><%=fecha.get(Calendar.YEAR) - i%></option>
<%}else{ %>
<option value="<%=fecha.get(Calendar.YEAR) - i %>"><%=fecha.get(Calendar.YEAR) - i%></option>
<%} %>
<%} %>
</select>
</td>
</tr>
<tr>
<td><b>Tipo programa:</b></td>
<td>
<select name="cmbTipoPgmAcd">
<%for (i=0; i<= v.size() - 1; i++){
TablasCodigosTO tcto = (TablasCodigosTO)v.elementAt(i); %>
<%if (prm_sTipoSel.equals(tcto.getCoDat())){ %>
<option value="<%= tcto.getCoDat() %>" selected="selected"><%=tcto.getTxDesAbrDat()%></option>
<%}else{ %>
<option value="<%= tcto.getCoDat() %>"><%=tcto.getTxDesAbrDat()%></option>
<%} %>
<%} %>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="btnMostrar" value="Mostrar"></input>
</td>
</tr>
<%if (m != null){ %>
<tr>
<td align="center" colspan="2">
<strong><u> Total <%=prm_sTipoSel %> / <%=prm_sFechaSel %></u></strong>
<%MedioDifusionTO count = (MedioDifusionTO)m.elementAt(0);
int total = count.getCantTotMedDifu();%>
</td>
</tr>
<tr>
<td colspan="2">
<table align="center" border=0>
<tr>
<% if(total >0){ %>
<td align="center">
<div id="piechart" style="width:300px;height:250px"></div>
</td>
<td align="center">
<div id="leyendapie"></div>
<br>
<div id="hover" align="center"></div>
</td>
</tr>
<tr>
<td colspan="2" align="center">

</td>
</tr>
<%}else{ %>
<tr>
<td>
&nbsp;
</td>
</tr>
<tr>
<td>
No se han encontrado postulantes para el filtro seleccionado.
</td>
<%} %>
</tr>
</table>
</td>
</tr>
</table>
<script language="javascript">
$.plot($("#piechart"),
[
<%for (i=1; i<= m.size() - 1; i++){
MedioDifusionTO to = (MedioDifusionTO)m.elementAt(i);%>
{ data: [[0, <%=to.getCantTotMedDifu()%>]], label: "<%=to.getNoMeDifu()%>"}
<%if (i!=m.size() - 1){%>,
<%}%>
<%}%>
],
{
series: {
pie: {
show: true,
label: {
show: true,
radius: 0.85,
innerRadius: 0.0,
formatter: function(label, series){
return '<div style="font-size:10pt;text-align:center;padding:1px;color:black;">'+Math.round(series.percent)+'%</div>';
},
background: { opacity: 0.0 }
},
stroke: {width: 0.1}
}

},
grid: {
hoverable: true,
clickable: true
},
legend:{
container: "#leyendapie"
}
});
$("#piechart").bind("plothover", pieHover);
$("#piechart").bind("plotclick", pieClick);

function pieHover(event, pos, obj)
{
if (!obj)
return;
valorX = parseInt(obj.datapoint[0]);
$("#hover").html('<span style="color: '+obj.series.color+'";><ul><li type=square></span><span font-weight: bold;">'+obj.series.label+': </span><span>'+valorX+' postulante(s)</span></ul>');
}

function pieClick(event, pos, obj)
{
if (!obj)
return;
valorX = parseInt(obj.datapoint[0]);
alert(''+obj.series.label+': '+valorX);
}
</script>
<%} %>
<%} %>
</form>
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder