Professional Documents
Culture Documents
Codificacion de Apoyo
Codificacion de Apoyo
REFERENCIAS MATERIALIZE
*********************************************************************************************************************
CABECERA:
PARTE INFERIOR:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('select').formSelect();
});
</script>
INDEX
*********************************************************************************************************************
<div class="row">
<div class="input-field col s12 m12 l12 xl12">
<i class="material-icons prefix">vpn_key</i>
<input type="text" id="txtcod" name="txtcod">
<label for="txtcod">Codigo</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<select id="cboest" name="cboest">
<option value="Epico">Epico</option>
<option value="Dramatico">Dramatico</option>
<option value="Lirico">Lirico</option>
<option value="Narrativo">Narrativo</option>
</select>
<label for="cboest">Seleccione Estilo</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<p>Editorial</p>
<p>
<label>
<input type="radio" name="opedi" id="op1" checked value="Molino" class="with-gap">
<span>Molino</span>
</label>
<label>
<input type="radio" name="opedi" id="op2" value="Santillana" class="with-gap">
<span>Santillana</span>
</label>
</p>
</div>
</div>
FILA CON BOTONES DE ENVIO
<div class="row">
<div class="input-field col s3">
<button name="btnreg" id="btnreg" class="btn waves-effect waves-light" type="submit">
Registrar<i class="material-icons right">save</i>
</button>
</div>
</div>
LISTAR REGISTROS
LISTENER.
*********************************************************************************************************************
@Override
public void contextInitialized(ServletContextEvent sce) {
sce.getServletContext().setAttribute("lispro", lispro);
}
....
PROCESAR.
*********************************************************************************************************************
if (cod.trim().length() == 0) {
liserr.add("LA CASILLA DEL CODIGO ESTA VACIA");
}
EXISTEN ERRORES EN LA LISTA O NO (GUARDAMOS O MOSTRAMOS ERRORES):
if (liserr.isEmpty()) {
Producto p = new Producto(cc,nom,pp,ss);
lispro.add(p);
getServletContext().setAttribute("lispro", lispro);
response.sendRedirect("index.jsp");
}else{
request.setAttribute("liserr", liserr);
request.getRequestDispatcher("ver_errores.view").forward(request, response);
}
MOSTRAR ERRORES
*********************************************************************************************************************
ELIMINAR REGISTRO
*********************************************************************************************************************