Entradas

Mostrando entradas de 2013

Agregar valores despues del contenido de una tabla

Html <table border="1" align="center" id="tabla_resultado" cellspacing="1" cellpadding="1" class="tabla" width="50%"> <tr>  <th rowspan="2" align="center">Resultado</th>  <th colspan="2" align="center">Tipo de Inicio</th>  <th rowspan="2" align="center">Total</th> </tr> <tr>  <th align="center">Entrante</th>  <th align="center">Saliente</th> </tr> </table> Javascript $('#tabla_resultado tr:last').after(      '<tr>' +                  '<td align="right"><b>' + resultado + '</b></td>' +                  '<td align="right">' + entrante + '</td>' +                  '<td align="right">' + saliente + '</td

Saber cuando se selecciono un checkbox

$('#personas').click(function() {     if($("#personas:checkbox").attr('checked') == true)     {            $("#valor_bloqueo").val($("#TipoBloqueo").val());     }     else     {            $("#valor_bloqueo").val("");     } });

Utilizando Qtip

AGREGAR LOS SIGUIENTES PLUGINS: Html  <script type="text/javascript" src="../js/jquery.qtip.js"></script>  <link rel="stylesheet" type="text/css" href="../css/jquery.qtip.css" />  <td>   <html:text    style="width: 70px;"    styleClass="input"    maxlength="3"    styleId="puntajeMinimo">                    </html:text>                                   </td>  <td><div id="msg_puntajeMinimo" style="display:none"><img src='../images/exclamation.gif'></div></td> Javascript if(puntaje_minimo >= 30 && puntaje_minimo<= 100) {  $("#puntajeMinimo").css(css_correcto);  $('#msg_puntajeMinimo').qtip('destroy');  $("#msg_puntajeMinimo").hide();  puntaje_min = true; } else {  $("#msg_puntajeMinimo").show();  $("#puntajeMinimo").css(css_i

Objeto Select

Deshabilitar objeto Select $("#Seleccionar").attr('disabled','true'); Obtener cantidad de opciones del objeto Select $("#Seleccionar").attr("length");

Agregar contenido a un objeto html

$("#contenido1").html('El puntaje mínimo ingresado es considerado como <b>¿Está seguro de aplicar este puntaje?</b>');

Validar Correo

function validar_correo(txt) {          //expresion regular    var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/;                //comentar la siguiente linea si no se desea que aparezca el alert()    //alert("Email " + (b.test(txt)?"":"no ") + "válido.");  /*  if(b.test(txt) == false)  {         $("#correo").css({ border: "1px dotted #990033" });   $("#msg_correo").css({ "color": "990033", "font-style": "italic" });   $("#msg_correo").html("<img src='../images/exclamation.gif'>&nbsp;Email invalido");  }  else  {   $("#correo").css({ border: "1px solid #aaaaaa" });   $("#msg_correo").html("");  }             */  //devuelve verdadero si validacion OK, y falso en caso contrario    return b.test(txt); }

CheckBox seleccionado por default

$("#personas:checkbox").attr('checked',true);

Estilos con Jquery

var css_correcto = {   'font-family' : 'Arial',   'font-size':'11px',   'background-color':'#FFFFFF',   'border':'#7F9DB9',   'border-style':'solid',   'border-top-width':'1px',   'border-right-width':'1px',   'border-bottom-width':'1px',   'border-left-width':'1px'         };  var css_incorrecto = {   'font-family' : 'Arial',   'font-size':'11px',   'background-color':'#FFFFFF',   'border':'1px dotted #990033',   'border-style':'solid',   'border-top-width':'1px',   'border-right-width':'1px',   'border-bottom-width':'1px',   'border-left-width':'1px'         }; $("#fechaInicio").css(css_correcto);

Alert al iniciar la pagina

$(document).ready(function() {       alert('Iniciando Proceso'); });

Keypress con Jquery

$('.input').keypress(function(e) {      if(e.which == 13)      {             $('form#login').submit();       } });

JAX-WS with JBoss

JBoss supports JAX-WS out of the box. There is not much configuration files needed, only a servlet-mapping in the web.xml . This is how the web-service java file looks like: package com.swayam.demo.webservice ; import javax.jws.WebMethod ; import javax.jws.WebParam ; import javax.jws.WebService ; /** * * @author paawak */ @WebService ( ) public class UserService {     /** * Web service operation */     @WebMethod ( operationName = "addUser" )     public Boolean addUser ( @WebParam ( name = "userName" )     String userName ) {         System . out . println ( "add user" ) ;         return Boolean . TRUE ;     } } Its a POJO with a @WebService annotation. All you have to do is map this as a servlet in the desired context. Though this is not a servlet per-se, the JBoss web container does the rest. This is how the web.xml looks like: <?xml version = "1.0" encoding = "UTF-8" ?>

Create SVN

Servidor subversion como servicio de windows Si el instalable no nos monta subversion como servicio de windows , podemos hacerlo de la siguiente manera. El ejecutable de servidor de subversion es svnserve.exe . Para crear un servicio con él debemos ejecutar el comando sc que viene con Windows de la siguiente manera, con permisos de administrador sc create svnserve binpath= "c:\svnserve\svnserve.exe --service --root c:\repos" displayname= "Subversion" depend= tcpip start= auto donde svnserve es el nombre que queremos dar al servicio, binpath contiene el comando a ajecutar ( svnserve.exe con sus opciones) y dentro de él --root apunta al directorio donde están nuestros repositorios de subversion ). displayname es el nombre que queremos que se vea para el servicio, depend es una dependencia del servicio, que depende de tcpip . Y start=auto indica que se arranque automáticamente al encender el ordenador. Crear repositorios En el direc

Backup and Restore SVN

  Backup SVN cmd> svnadmin dump c:\repo\proj1 > c:\proj_backup\proj1_date Restore SVN cmd> svnadmin create c:\repo_path\proj1_new cmd> svnadmin load c:\repo_path\proj1_new < c:\proj_backup\proj1_date cmd> rmdir /s c:\repo_path\proj1_new