-1

Hi,I Am writing JavaScript to display JSP pages in JavaScript tabs,all JSP pages displays dynamic data,all JSP pages are working fine if i run individually,when i try to make it as tabs jsp pages are not working.can any one help me to solve this problem.
my JS code:

var tabPanel = new Ext.TabPanel({
        activeTab         : 0,
		height            : 400,
        width             : 450,
        id                : 'myTPanel',
        enableTabScroll   : true,
        items             : [  
								{
									title:'Summary',
									autoLoad: infoUrl + param + "&rand="+Math.random()
								},
								{
									title:'Pump/Bore',
									//autoLoad: 'page1.jsp'
									</div><jsp:include page="page1.jsp" /></div>
								},{
									title:'Second',
									autoLoad: 'page2.jsp'
								},{
									title:'Third',
									autoLoad: 'page3.jsp'
								}
        ]
    });
    
    new Ext.Window({
		title:'Consumer Data',
        height : 400,
        width  : 450,
        //layout : 'fit',
        items  : tabPanel,
		listeners: {
				close: function (thisWindow) {
					thisWindow.destroy();
				  }
		}
    }).show();
  }
}

Edited by ~s.o.s~: Added code tags, learn to use them.

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by prismily
-2

Explain more aht is happening.

SNIP

Edited by happygeek: fake sig deleted

Votes + Comments
no advert links please, use signature facility
get lost
0

Hi,I Am writing JavaScript to display JSP pages in JavaScript tabs,all JSP pages displays dynamic data,all JSP pages are working fine if i run individually,when i try to make it as tabs jsp pages are not working.can any one help me to solve this problem.
my JS code:

var tabPanel = new Ext.TabPanel({
        activeTab         : 0,
		height            : 400,
        width             : 450,
        id                : 'myTPanel',
        enableTabScroll   : true,
        items             : [  
								{
									title:'Summary',
									autoLoad: infoUrl + param + "&rand="+Math.random()
								},
								{
									title:'Pump/Bore',
									//autoLoad: 'page1.jsp'
									</div><jsp:include page="page1.jsp" /></div>
								},{
									title:'Second',
									autoLoad: 'page2.jsp'
								},{
									title:'Third',
									autoLoad: 'page3.jsp'
								}
        ]
    });
    
    new Ext.Window({
		title:'Consumer Data',
        height : 400,
        width  : 450,
        //layout : 'fit',
        items  : tabPanel,
		listeners: {
				close: function (thisWindow) {
					thisWindow.destroy();
				  }
		}
    }).show();
  }
}

This is JSP page

<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.util.*"%>
<%@page import="com.enzen.cis.beans.ConsumptionDetails"%>
<%@page import="com.enzen.cis.beans.ConsumptionBean"%>
<%@page import="java.sql.Connection"%>
<%@page import="com.enzen.cis.util.DBConnector"%>
<%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!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=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
String avg="0.00";
ResultSet rs=null;
String f1=null;
Statement statement=null;
%>
<%
		// String consumption_idt = request.getParameter("consumer_id");
		HashMap<String,Object> consumption_data = new HashMap<String,Object>();
		ServletContext context = this.getServletContext();
		String dbhost = context.getInitParameter("dbhost");
		String port = context.getInitParameter("dbport");
		String db = context.getInitParameter("db");
		String dbuser = context.getInitParameter("dbuser");
		String dbpassword = context.getInitParameter("dbpasswd");
		DBConnector dbconnector = new DBConnector(dbhost, port, db, dbuser, dbpassword);
		System.out.println("Connection Established");
		Connection con = dbconnector.getConnection();
		
		ConsumptionDetails condata= new ConsumptionDetails();
		consumption_data= condata.GetConsumptionData(con,"1");
		
		if(consumption_data.get("error").equals("false")) {
		avg = consumption_data.get("avg").toString();
%>
<table border="1">
<tr>
<th width=100><b>Month</b></th>
<th width=100><b>Consumption Units</b></th>
<% 
ArrayList beanList = new ArrayList(); 
	
beanList =(ArrayList)consumption_data.get("bean");

Iterator it=beanList.iterator();

while (it.hasNext()){
 ConsumptionBean bean=(ConsumptionBean)it.next();
%>
<tr><td><%=bean.getMonth()%></td><td><%=bean.getCons_units()%></td></tr>

<%
}%>
<tr><td><b>AVERAGE</b></td><td><%=avg%></td></tr>
<%
} else {
%>
<h3>Error : Problem Retrieving consumption details</h3>
<h4><%=consumption_data.get("error_data") %></h4>
<%
}
		consumption_data.clear();
%> 
</tr>
</table>

if i run this jsp page alone i'm able to populate the data dynamically.if i call this same page with tab controls, page is not loading.

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.