Foros del Web » Programación para mayores de 30 ;) » Java »

Problema JSP y Explorer 7.0

Estas en el tema de Problema JSP y Explorer 7.0 en el foro de Java en Foros del Web. Hola amigos, tengo un menu hecho en jsp y javascript que rescata los dominios y sub-dominios de una bd pero no se me ve en ...
  #1 (permalink)  
Antiguo 17/05/2007, 16:32
 
Fecha de Ingreso: abril-2007
Mensajes: 6
Antigüedad: 17 años
Puntos: 0
Problema JSP y Explorer 7.0

Hola amigos, tengo un menu hecho en jsp y javascript que rescata los dominios y sub-dominios de una bd pero no se me ve en explorer 7.0, ojalas tengan alguna solucion a esto, se agredece de ante mano

Código:
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/struts-html-el.tld" prefix="html" %>

<script language="Javascript">
//Do you want images (if not set to 0 and remove the images from the body)?
foldImg=1;

//Here are the images for the top links.
foldinImg=new Image(); foldinImg.src="<html:rewrite page="/static/images/foldoutmenu2_arrow.gif"/>";
foldoutImg=new Image(); foldoutImg.src="<html:rewrite page="/static/images/foldoutmenu2_arrow_open.gif"/>";

//Here are the images for the sub links.
foldsubinImg=new Image(); foldsubinImg.src="<html:rewrite page="/static/images/foldoutmenu2_arrow.gif"/>";
foldsuboutImg=new Image(); foldsuboutImg.src="<html:rewrite page="/static/images/foldoutmenu2_arrow_open.gif"/>";
//If you change the images above please remember to change the images in the actual page as well.

// se cambio el document.app.location.href por app.location

function executeProceso(procesoCode, wasPagina) {
	if (wasPagina == ""){
		app.location="<html:rewrite page="/callhahtsite.do?hahtUrl=/HAHTpage/portal.Menu.runProceso?hidProcesoCode="/>"+procesoCode;
	} else {
		//document.app.location.href="<html:rewrite page="/"/>"+wasPagina;
		app.location="/b2bWeb/"+wasPagina;
	}
}
function executeActividad(actividadCode, wasPagina) {
	 if (wasPagina == ""){
		app.location="<html:rewrite page="/callhahtsite.do?hahtUrl=/HAHTpage/portal.Menu.runActividad?hidActividadCode="/>"+actividadCode;
	}
 else {
		app.location="/b2bWeb/"+wasPagina;
	}
}
function executeOpcion(opcionCode, wasPagina) {
	if (wasPagina == ""){
		app.location="<html:rewrite page="/callhahtsite.do?hahtUrl=/HAHTpage/portal.Menu.runOpcion?hidOpcionCode="/>"+opcionCode;
	} else {
		//document.app.location.href="<html:rewrite page="/"/>"+wasPagina;
		app.location="/b2bWeb/"+wasPagina;
	}
}

</script>

<script type="text/javascript" src="<html:rewrite page='/static/scripts/menu.js' />"></script>    
<link rel="stylesheet" type="text/css" href="<html:rewrite page='/static/styles/menu.css' />" />
<div class="menu">
<c:forEach var="dominio" items="${Dominios}">
  <c:if test="${dominio.codigo == DominioCode}">
  <p>&nbsp;</p>
  <TABLE width="150" border="0" cellspacing="0" cellpadding="0">
    <TR STYLE="font-size : 5px; border-top-style : none; border-bottom-style : none; border-left-style : none; border-right-style : none; border-top-width : 0px; border-bottom-width : 0px; border-left-width : 0px; border-right-width : 0px; height : 10px;">
      <TD width="5" colspan="2">&nbsp;</TD>
    </TR>
    <TR>
      <TD width="4">
        <DIV align="LEFT">&nbsp;</DIV>
      </TD>
      <TD background="<html:rewrite page="/static/images/bg_b.gif"/>" CLASS="clTitulo" width="150" height="20">
	      <c:out value="${dominio.titulo}" />
       </TD>
    </TR>
    <TR>
      <TD colspan="2">
		<DIV id="divFoldCont">   	
		<c:forEach var="proceso" items="${dominio.procesos}" varStatus="statusProceso">
		<c:choose> 
		<c:when test="${empty proceso.accion}"> 
			<DIV id="divFold<c:out value="${statusProceso.index}" />" class="clFold">
			<table border=0 width=149 cellspacing=0 cellpadding=0>
			<tr><td class='clBorde'>
			 	<table border=0 width=148 cellspacing=0 cellpadding=0 bordercolor="#f7f7f7"><tr>
			 		<td valign="top"><img src="<html:rewrite page="/static/images/foldoutmenu2_arrow.gif" />" name="imgFold<c:out value="${statusProceso.index}" />"  border=0 align="middle" hspace=2 vspace="4"></td>
					<td id="proceso<c:out value="${proceso.codigo}"/>" width=133 valign="top"><a href="javascript:foldmenu(<c:out value="${statusProceso.index}" />,1);"  class="clFoldLinks" title='+'><c:out value="${proceso.titulo}" /></a></td></tr>
				</table>
			</table>
			<c:forEach var="actividad" items="${proceso.actividades}" varStatus="statusActividad">
			<c:choose> 
			<c:when test="${empty actividad.accion}"> 
				<DIV id="divFoldSub<c:out value="${statusProceso.index}" />_<c:out value="${statusActividad.index}" />" class="clFoldSub">
					<table border=0 width=149 cellspacing=0 cellpadding=0>
					<tr><td class="clBorde">
						<table border=0 width=148 cellspacing=0 cellpadding=0 bordercolor="#f7f7f7"><tr>
							<td width=10>&nbsp;</td><td width=4 valign="top"><img src="<html:rewrite page="/static/images/foldoutmenu2_arrow.gif"/>" name="imgFold<c:out value="${statusProceso.index}" />Sub<c:out value="${statusActividad.index}" />"  border=0 align="middle" vspace="4"></td>
							<td id="actividad<c:out value="${actividad.codigo}"/>" width=133 valign="top" STYLE='display : block;'><a href="#" onclick="subfoldmenu(<c:out value="${statusProceso.index}" />,<c:out value="${statusActividad.index}" />)" class="clSubLinks" title='+'><c:out value="${actividad.titulo}"/></a></td></tr>
						</table>
					</td></tr>
					</table>
					<DIV id="divFoldSub<c:out value="${statusProceso.index}" />_<c:out value="${statusActividad.index}" />_0" class="clFoldSub2">
					<c:forEach var="opcion" items="${actividad.opciones}">
						<table width=149 border=0 cellspacing=0 cellpadding=0 ><tr><td width=150 class='clBorde'>
							<table width=148 border=0 cellspacing=0 cellpadding=1 bordercolor="#f7f7f7"><tr>
								<td width=15>&nbsp;</td><td width=4><img src="<html:rewrite page="/static/images/foldoutmenu2_arrow.gif"/>" name="imgFold<c:out value="${statusProceso.index}" />Sub<c:out value="${statusActividad.index}" />"  border=0 align="middle" vspace="4"></td>
								<td id="opcion<c:out value="${opcion.codigo}"/>" width=128 valign=top><A HREF="javascript:executeOpcion('<c:out value="${opcion.codigo}"/>', '<c:out value="${opcion.WASPagina}"/>');" class="clSubLinks2" title="<c:out value="${opcion.descripcion}"/>"><c:out value="${opcion.titulo}"/></A></td></tr>
							</table></td></tr>
						</table> 
					</c:forEach>
	</DIV>
                </DIV>
				</c:when>
				<c:otherwise>                                  
				<DIV id="divFoldSub<c:out value="${statusProceso.index}" />_<c:out value="${statusActividad.index}" />" class="clFoldSub">
					<table width=149 border=0 cellspacing=0 cellpadding=0><tr><td class='clBorde'>
						<table width=148 border=0 cellspacing=0 cellpadding=1 bordercolor="#f7f7f7"><tr><td width=10>&nbsp;</td>
							<td width=4 valign="top"><img src="<html:rewrite page="/static/images/bullet_sec.gif" />" name="imgFold<c:out value="${statusProceso.index}" />Sub<c:out value="${statusActividad.index}" />"  border=0 align="middle" vspace="4"></td>
							<td id="actividad<c:out value="${actividad.codigo}"/>" width=133 valign="top" STYLE='display : block;'><a href="javascript:executeActividad('<c:out value="${actividad.codigo}"/>','<c:out value="${actividad.WASPagina}"/>');" onclick="subfoldmenu(<c:out value="${statusProceso.index}" />,-1);" class="clSubLinks" title="<c:out value="${actividad.descripcion}"/>"><c:out value="${actividad.titulo}"/></a></td></tr>
						</table>
					</table>
					<DIV id="divFoldSub<c:out value="${statusProceso.index}" />_<c:out value="${statusActividad.index}" />_0" class="clFoldSub2"></DIV>
				</DIV>
	         </c:otherwise>
	         </c:choose>
			</c:forEach>
           </DIV>
         </c:when>
         <c:otherwise>
			<DIV id="divFold<c:out value="${statusProceso.index}" />" class="clFold">          
	           <table border=0 width=149 cellspacing=0 cellpadding=0><tr><td class='clBorde'>
           			<table border=0 width=148 cellspacing=0 cellpadding=1 bordercolor="#f7f7f7"><tr>
           				<td width=4 valign="top"><IMG src="<html:rewrite page="/static/images/bullet_sec.gif" />" name="imgFold<c:out value="${statusProceso.index}" />"  border=0 align="middle" hspace=2 vspace="4"/></td>
           				<td id="proceso<c:out value="${proceso.codigo}"/>" width=133 valign="top" ><A HREF="javascript:executeProceso('<c:out value="${proceso.codigo}"/>','<c:out value="${proceso.WASPagina}"/>');" onclick="foldmenu(<c:out value="${statusProceso.index}" />,-1);" class="clFoldLinks" title='<c:out value="${proceso.descripcion}"/>'><c:out value="${proceso.titulo}"/></A></td></tr>
           			</table></td></tr>
	           </table>
	           <DIV id="divFoldSub<c:out value="${statusProceso.index}" />_<c:out value="${statusActividad.index}" />" class="clFoldSub2"></DIV>
           </DIV>
         </c:otherwise>
         </c:choose>
		</c:forEach>
	</c:if>
</c:forEach>
		</DIV>       
  	</TR>
  </TABLE>
</div>
  #2 (permalink)  
Antiguo 18/05/2007, 02:14
Avatar de cris_maco  
Fecha de Ingreso: abril-2007
Ubicación: Salamanca
Mensajes: 254
Antigüedad: 17 años
Puntos: 0
Re: Problema JSP y Explorer 7.0

has probado con otros navegadores? Es por descartar si es problema del programa o de internet explorer
  #3 (permalink)  
Antiguo 18/05/2007, 08:07
 
Fecha de Ingreso: abril-2007
Mensajes: 6
Antigüedad: 17 años
Puntos: 0
Re: Problema JSP y Explorer 7.0

Hola, con explorer 6.0 y Firefox anda de maravilla pero el explorer 7.0 nada no se ve nada solo el titulo, lo malo es que para las personas que hago el menu lo quieren en el famoso explorer 7.0

Saludos .......
  #4 (permalink)  
Antiguo 18/05/2007, 09:50
 
Fecha de Ingreso: octubre-2003
Mensajes: 3.578
Antigüedad: 20 años, 6 meses
Puntos: 51
Re: Problema JSP y Explorer 7.0

Apostaria a que es un problema de JavaScript. Así de buenas a primeras no le veo nada raro, pero seguramente al generar el HTML haya algo que al Explorer 7 no le guste. ¿Has comprobado si la librería de arbol que usas es compatible con Explorer 7?

¿El menu que intentas hacer es un estilo arbol? Para estos casos a veces es mas sencillo hacerlos con CSS y partir de una lista en HTML, para no tener que complicarse con tablas y demas. Quizá usando otra librería...

Algunos basados en listas que he visto:
http://inspire.server101.com/js/xc/
http://www.bleedingego.co.uk/code/js/listmenu/
http://bakketun.net/dev/js/listmenu/

Yo basandome en esos hice uno, que es el que suelo usar.
S!
  #5 (permalink)  
Antiguo 24/05/2007, 09:34
 
Fecha de Ingreso: abril-2007
Mensajes: 6
Antigüedad: 17 años
Puntos: 0
Re: Problema JSP y Explorer 7.0

Hola gracias por tu ayuda, me puse a revisar la libreria y ahi solucione el problema

Código:
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.opera7=this.agent.indexOf("Opera 7")>-1
	this.ie5=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}

var bw=new lib_bwcheck();

if(document.layers){ //NS4 resize fix...
	scrX= innerWidth; scrY= innerHeight;
	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }
}

if(navigator.userAgent.indexOf('Opera 5')>-1 && document.getElementById){ //Opera 5 resize fix.
	scrX= innerWidth; scrY= innerHeight;
	document.onmousemove= function(){
		if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){
			scrX = innerWidth;
			scrY = innerHeight;
			foldInit();
		}
	};
}

mainmenus=15 //How many main menus do you have?

//How many submenus do you have beneath each main level.
submenus=new Array(15,15,15,15,15,15,15,15,15,15,15,15,15,15,15) 
//In this example I have 3 submenus in the first top menu,
//3, in the second, 2 submenus in the third top menu and 3 in the forth.
//It's really important that these numbers are correct.

pxbetweenmain = 0 //How much space should there be between the main menus
pxbetweensub = 0 //How much space should there be between the sub menus

mainstayfolded = false //Should the main menus stay folded?
substayfolded = false  //Should the sub menus stay folded?  Play with these 2 variables.

/************************************************************************************
Making cross-browser objects
************************************************************************************/
function makeMenu(obj,nest){
    this.nameo=obj;
    nest=(!nest) ? "":'document.'+nest+'.';
	if ((document.getElementById && document.getElementById(obj)) ||
	    (document.all && document.all[obj])) {
        
	   	this.css= bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
	
		this.elm= bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	
		this.ref= bw.dom || bw.ie4? document:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
	    
		this.x= bw.ns4?this.css.left:bw.opera5?this.css.pixelLeft:this.elm.offsetLeft;
		this.y= bw.ns4?this.css.top:bw.opera5?this.css.pixelTop:this.elm.offsetTop;
		this.height= bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:this.elm.offsetHeight;
		this.hideIt= b_hideIt;
		this.showIt= b_showIt;
		this.moveIt= b_moveIt;
		this.status= 0;	
	}
	else {
	   this.x=0;
	   this.y=0;
	   this.height=0;
	   this.hideIt= n_hideIt;
	   this.showIt= n_showIt;
       this.moveIt= n_moveIt;
       this.status= 9;	
	}
	return this;
	
}
// A unit of measure that will be added when setting the position of a layer.
//var px = bw.ns4||window.opera?"":"px";
var px = bw.ns4?"":"px";

function b_showIt(){this.css.visibility="visible"; this.status=1}
function b_hideIt(){this.css.visibility="hidden"; this.status=0}
function b_moveIt(x,y){this.x=x; this.y=y; /*this.css.left=this.x+px;*/ this.css.top=this.y+px;}
// Funciones div vacios
function n_showIt(){}
function n_hideIt(){}
function n_moveIt(x,y){}
/************************************************************************************
Initiating the page and making the menu
************************************************************************************/
function foldInit(){
	//Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
	bw.opera5 = (navigator.userAgent.indexOf("Opera 5")>-1 && document.getElementById)?true:false
	if (bw.opera5) bw.ns6 = 0
	
	//Creating the foldoutmenu
	oFold = new Array();
	y = 0;
	for (var i=0; i<mainmenus; i++){
		oFold[i] = new makeMenu('divFold'+i,'divFoldCont');
		oFold[i].moveIt(0,y);
		oFold[i].size = oFold[i].height;
		y += oFold[i].height+pxbetweenmain;
		if (bw.ns4) oFold[i].css.clip.bottom = 500;
		oFold[i].sub = new Array();
		oFold[i].subs = top_subs;
		suby = oFold[i].height+pxbetweensub;
		for (var j=0; j<submenus[i]; j++){
			oFold[i].sub[j] = new makeMenu('divFoldSub'+i+'_'+j,'divFoldCont.document.divFold'+i);
			oFold[i].sub[j].sub = new makeMenu('divFoldSub'+i+'_'+j+'_0','divFoldCont.document.divFold'+i+'.document.divFoldSub'+i+'_'+j);
			oFold[i].sub[j].hideIt();
			oFold[i].sub[j].sub.hideIt();
			oFold[i].sub[j].moveIt(10,suby);
			suby += oFold[i].sub[j].height+pxbetweensub;
		}
	}
  	oFoldCont = new makeMenu('divFoldCont');
	if (bw.ns4) oFoldCont.css.clip.bottom = 800;
  	oFoldCont.showIt(); //Showing the menu when the menu have been "created"
}
/************************************************************************************
Object function to the top of the menus.
************************************************************************************/
function top_subs(show, num){
	for (var j=0; j<this.sub.length; j++){
		if (show){
			this.sub[j].showIt()
//			if (foldImg) this.ref["imgFold"+num].src = foldoutImg.src
			if (substayfolded){if(this.sub[j].sub.status) this.sub[j].sub.showIt()
			}else{
//				if (foldImg) this.sub[j].ref["imgFold"+num+"Sub"+j].src = foldsubinImg.src
				this.sub[j].sub.hideIt()
			}
		}else{
			this.sub[j].hideIt()
//			if (foldImg) this.ref["imgFold"+num].src = foldinImg.src
			if (!substayfolded) this.sub[j].sub.hideIt()
			else if (substayfolded) this.sub[j].sub.css.visibility="hidden"
		}
	}
}
/************************************************************************************
Checking height of the menus, and moves them to the correct position.
************************************************************************************/
function checkheight(org){
	if(mainstayfolded) istart=org; else istart=0
	for(i=istart;i<oFold.length;i++){
		oFold[i].size=oFold[i].height
		for(j=0;j<oFold[i].sub.length;j++){
			oFold[i].sub[j].size=oFold[i].sub[j].height+pxbetweensub
			if(oFold[i].sub[j].status){
				oFold[i].size+=oFold[i].sub[j].size
				if(oFold[i].sub[j].sub.status){
					oFold[i].size+=oFold[i].sub[j].sub.height+pxbetweensub
					oFold[i].sub[j].size+=oFold[i].sub[j].sub.height+pxbetweensub
				}
			}
			if(j!=0) oFold[i].sub[j].moveIt(10,oFold[i].sub[j-1].y+oFold[i].sub[j-1].size)
		}
		if(i!=0) oFold[i].moveIt(0,oFold[i-1].y+oFold[i-1].size+pxbetweenmain)
//		if(i!=0) oFold[i].moveIt(0,oFold[i-1].y+oFold[i-1].size)
	}
}
/************************************************************************************
Fold in and out the submenus.
************************************************************************************/
function subfoldmenu(main,sub){
//    parent.show.location.href="about:blank";
//	parent.show.location.href='/*==hahtSession.createStaticURL("blank.htm")*/';
	if (!substayfolded){
		for (var i=0; i<oFold[main].sub.length; i++){
			if (i!=sub){
//         	    alert("hide"+ main + "/" + sub)
				oFold[main].sub[i].sub.hideIt();
//				if (foldImg) oFold[main].sub[i].ref["imgFold"+main+"Sub"+i].src = foldsubinImg.src
			}
		}
	}
	if (sub >= 0) {
//	   alert(""+ main + "/" + sub)
	   if (!oFold[main].sub[sub].sub.status){
	   	  oFold[main].sub[sub].sub.showIt()
//		  if(foldImg) oFold[main].sub[sub].ref["imgFold"+main+"Sub"+sub].src = foldsuboutImg.src
	   }
	   else{
	   	  oFold[main].sub[sub].sub.hideIt()
//		  if(foldImg) oFold[main].sub[sub].ref["imgFold"+main+"Sub"+sub].src = foldsubinImg.src
	   }
	   checkheight(main)
	}
	else
       checkheight(main)	
}
/************************************************************************************
Fold in and out the mainmenus
************************************************************************************/
function foldmenu(num,tipo){
//    parent.show.location.href="about:blank";
//	parent.show.location.href='/*==hahtSession.createStaticURL("blank.htm")*/';
	if (!mainstayfolded){
		for(var i=0; i<oFold.length; i++){
			if(i!=num) oFold[i].subs(0,i)
		}
	}
	if (tipo  >=  0 ) {
  	   if (!oFold[num].sub[0].status) oFold[num].subs(1,num)
	   else oFold[num].subs(0,num)
	   checkheight(num)
	}
	else 
	   checkheight(num)	
}
//Initiating the menus onload, if the browser is ok.
if(bw.bw) onload = foldInit;

function statwords(message){
   window.status = message;
}
antes estaba asi

Código:
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
Ahora lo deje asi y funciona bien, hasta el momento

Código:
this.ie5=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
Segun mi poca experiencia no funcionaba porque quizas no tenia como alternativa el explorer 7.0

Saludos y gracias por tu ayuda ....
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:31.