Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/02/2009, 22:45
shadowner
 
Fecha de Ingreso: diciembre-2008
Ubicación: Medellín, Colombia
Mensajes: 6
Antigüedad: 16 años, 2 meses
Puntos: 0
Respuesta: crear checkbox dinamico help!!!!!

Este código hace justo lo que tú necesitas, yo ya lo tenía implementado hace unos meses en una aplicación. Espero que te sea útil.
__________________________________________________ __
<%@page info="Author: Mauricio Porras P." contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,GNReporter.*,GNReporter.CXP.*,j ava.text.*,Util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../css/GNReporter.css" rel="stylesheet" type="text/css">
<script src="../../js/GNReporter.js" type="text/javascript"></script>
<title>Reportar Pagos</title>
</head>
<body>
<div class="Title">Reportar Pagos</div>
<br>
Usted está en: <a href="#" onclick="window.opener.focus()">Inicio</a> > Reportar Pagos
<br><br>
<%
// Report
if (request.getParameter("btnReport") != null) {
out.println("Reportando...");
out.println(request.getParameter("hidRecords"));
return;
}
%>
<%
String sDateInitial = request.getParameter("txtDateInitial");

sDateInitial = sDateInitial == null ? "30/06/2007" : sDateInitial;
%>
<form action="ReportarPagos.jsp" method="post" onsubmit="return ValidateForm(this)">
<table align="center">
<tr>
<td>
Fecha
<input type="text" name="txtDateInitial" size="11" class="FlatTextBox" value=<%="\"" + sDateInitial + "\""%>>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="txtGenerate" value="Generar" class="FlatButton">
</td>
</tr>
</table>
<br>
<%
// Generate report
if (request.getParameter("txtGenerate") == null) {
return;
}

ResultSet oRS = ReportarPagos.getEncabezados((String) session.getAttribute(Usuarios.UsuarioIdSessionKey) , sDateInitial);

if (oRS.next() == false) {
out.println(Model.NoDataFound);
return;
}
%>
<table width="1500">
<tr>
<td>
<table>
<tr>
<th></th>
<th>Dcto.</th>
<th>NIT</th>
<th>Nombre</th>
<th>E-Mail</th>
<th>No. Cuenta</th>
<th>Entidad</th>
<th>Valor</th>
<th>Reportar</th>
<th>Acuse Recibido</th>
</tr>
<%
NumberFormat oNF = NumberFormat.getNumberInstance();
int nRecord = 0;
String sEMail = "";
boolean bEMailValid = false;

oRS.beforeFirst();
while (oRS.next()) {
nRecord++;
// Validate Email
sEMail = oRS.getString(4).trim();
bEMailValid = GNString.EmailIsValid(sEMail);

%>
<tr>
<th><%=nRecord%></th>
<td><%=oRS.getString(1)%></td>
<td><%=oRS.getString(2)%></td>
<td><%=oRS.getString(3)%></td>
<td><%=sEMail%></td>
<td><%=oRS.getString(5)%></td>
<td><%=oRS.getString(6)%></td>
<td align="right"><%=oNF.format(oRS.getDouble(7))%></td>
<td>
<input type="checkbox" name="chkEsAdministrador" onclick="Testing()"/>
</td>
<td>
<input type="checkbox" name="chkEsAdministrador"/>
</td>
</tr>
<%
}
%>
<tr>
<td colspan="10" align="center">
<input type="submit" name="btnReport" value="Reportar Ahora" class="FlatButton">
</td>
</tr>
</table>
<input type="hidden" name="hidRecords" value=<%="\""+nRecord+"\""%>>
</td>
</tr>
</table>
</form>
</body>
</html>
__________________________________________________ __

Pdt: Lamento la tardanza pero el foro no me había hecho reply ;)