ratxamala26 de Septiembre del 2005
PreguntaActualmente genero el listado de una tabla y despliega los campos necesarios entre los cuales esta el ID de la tabla, al final de listar todos los regidtros tengo un inputbox donde escribo el ID y le doy click al boton BORRAR llamandome a un servlet el cual me borrra correctamente el registro.
Lo que deseo en si es que solo me genere el listado y que me convierta todos los ID en hipervinculos a los cuales al dar click salga una ventana que diga "realmente desea borrar este registro" SI NO
y que el boton SI me llame al servlet de borrar.
Espero pronta respuesta gracias
adjunto el jsp de listado
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%
ResultSet rs = user.consultaUsuario();
%>
<html>
<head>
<title>Eliminar Usuario</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
<!--
.Estilo1 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
color: #006699;
background-color: #FFFFFF;
}
body {
background-image: url(../imagenes/fondo.jpg);
}
-->
</style>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<table width="72%" border="0" align="center">
<td width="17%"><div align="center"></div></td>
<td width="26%" bgcolor="#0099CC"><div align="center" class="Estilo1">
<div align="center"><strong>ID PERMISOS</strong></div>
</div></td>
<td width="26%" bgcolor="#0099CC"><div align="center" class="Estilo1">
<div align="center"><strong>LOGIN</strong></div>
</div></td>
<td width="31%" bgcolor="#0099CC"><div align="center" class="Estilo1">
<div align="center"><strong>TIPO DE USUARIO </strong></div>
</div></td>
<%
while(rs.next()){
int n = rs.getInt("idpermisos");
String t = rs.getString("login");
String e = rs.getString("tipo");
%>
<tr>
<td><div align="center"></div></td>
<td><div align="center"><%=n%> </div></td>
<td><div align="center"><%=t%> </div></td>
<td><div align="center"><%=e%> </div></td>
</tr>
<%
}
%>
</table>
<%
rs.close();
rs = null;
%>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name="form1" method="post" action="../servlet/trionix.EliminarUsuario">
<table width="100%" border="0">
<tr>
<td height="26"> </td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td width="39%"> </td>
<td width="14%" class="Estilo1">Id Permisos </td>
<td colspan="2"><input name="idpermisos" type="text" id="idpermisos" size="20" maxlength="20"></td>
</tr>
<tr>
<td> </td>
<td class="Estilo1"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td class="Estilo1"> </td>
<td width="11%"><input type="submit" name="Submit" value="Eliminar"></td>
<td width="36%"><input name="Reset" type="reset" id="Reset" value="Borrar"></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
Lo que deseo en si es que solo me genere el listado y que me convierta todos los ID en hipervinculos a los cuales al dar click salga una ventana que diga "realmente desea borrar este registro" SI NO
y que el boton SI me llame al servlet de borrar.
Espero pronta respuesta gracias
adjunto el jsp de listado
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%
ResultSet rs = user.consultaUsuario();
%>
<html>
<head>
<title>Eliminar Usuario</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
<!--
.Estilo1 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
color: #006699;
background-color: #FFFFFF;
}
body {
background-image: url(../imagenes/fondo.jpg);
}
-->
</style>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<table width="72%" border="0" align="center">
<td width="17%"><div align="center"></div></td>
<td width="26%" bgcolor="#0099CC"><div align="center" class="Estilo1">
<div align="center"><strong>ID PERMISOS</strong></div>
</div></td>
<td width="26%" bgcolor="#0099CC"><div align="center" class="Estilo1">
<div align="center"><strong>LOGIN</strong></div>
</div></td>
<td width="31%" bgcolor="#0099CC"><div align="center" class="Estilo1">
<div align="center"><strong>TIPO DE USUARIO </strong></div>
</div></td>
<%
while(rs.next()){
int n = rs.getInt("idpermisos");
String t = rs.getString("login");
String e = rs.getString("tipo");
%>
<tr>
<td><div align="center"></div></td>
<td><div align="center"><%=n%> </div></td>
<td><div align="center"><%=t%> </div></td>
<td><div align="center"><%=e%> </div></td>
</tr>
<%
}
%>
</table>
<%
rs.close();
rs = null;
%>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form name="form1" method="post" action="../servlet/trionix.EliminarUsuario">
<table width="100%" border="0">
<tr>
<td height="26"> </td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td width="39%"> </td>
<td width="14%" class="Estilo1">Id Permisos </td>
<td colspan="2"><input name="idpermisos" type="text" id="idpermisos" size="20" maxlength="20"></td>
</tr>
<tr>
<td> </td>
<td class="Estilo1"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td class="Estilo1"> </td>
<td width="11%"><input type="submit" name="Submit" value="Eliminar"></td>
<td width="36%"><input name="Reset" type="reset" id="Reset" value="Borrar"></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
