Deprecated: Function set_magic_quotes_runtime() is deprecated in /home4/mfoster/public_html/cb/forums/include/common.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 34
Cross-Browser.com / X library and JSP

Cross-Browser.com

X Library Forums

You are not logged in.

Announcement

New user registration is currently disabled.

#1 June 3, 2010 11:54:23 pm

rudranee
New Member
Registered: June 3, 2010
Posts: 9

X library and JSP

Hi,
I would like to know how to implement XFixedHeader and XColHide to a JSP page that shows dynamic data?

Please give some advice.
Thanks in advance.


Rudranee

Offline

 

#2 June 4, 2010 6:07:35 am

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Here is my sample code:

<%@page import="java.sql.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ include file="./connection.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<%@ include file="./header.html"%>
<!-- <script type='text/javascript' src='./X_library/offline.js'></script> -->
<script type='text/javascript' src='./X_library/x/x.js'></script>
<script type='text/javascript' src='./X_library/x/lib/xtableheaderfixed.js'></script>
<link rel='stylesheet' type='text/css' href='./X_library/css/v3.css'>
<link rel='stylesheet' type='text/css' href='./X_library/x/examples/xthf-sep.css'>
<script type='text/javascript' src='./X_library/x/examples/xthf1-xlib.js'></script>
<script type='text/javascript'>
xAddEventListener(window, 'load',
  function() {
    new xTableHeaderFixed('xthf-site', 'data-container');
  }, false
);
</script>
</head>
<body>
<FORM action="./FIR_Req.jsp" method="post">
<% SimpleDateFormat df=new SimpleDateFormat("dd-MMM-yy");
String uname=String.valueOf( session.getAttribute("uname"));
if(uname.equals("null"))
{
out.println("<form action=./index.html>");
out.println("<center><font color=red size=5>Wrong User name OR password</center><BR><BR>");
out.println("<center><input type=Submit value='Login Again'></center>");    
out.println("</form>");
}
else
{
String thisprj=(String) session.getAttribute("proj");
int pid=Integer.parseInt(thisprj);
String status=request.getParameter("status");
String usr=(String) session.getAttribute("user");
String name=(String) session.getAttribute("Name");
String login=(String) session.getAttribute("uname");
String prj="",dept="",acc_date,compdate="null",IFdate="null",firno="",project="",team="",wo="",req_dept="",agg="",domain="",antype="",prjst="",info="",username="";
int cnt=0;
rs=stmt.executeQuery("select Dept from Login where Login='"+uname+"'");
while(rs.next()) { dept=rs.getString(1); }
rs.close();
rs=stmt.executeQuery("select ProjectName from Project where PID="+pid);
while(rs.next()){ prj=rs.getString(1); }
rs.close();
session.setAttribute("status",status);
try{  %>
<div id='topcontent'>
 <p><font size=6 color="#A52A2A" type="Verdana"><center>
<%if(usr.equals("ra")) {%><br><b><%=status%> Requests For Project "<%=prj%>"</b> 
<% } else{ if(usr.equals("an")) {%> <br><b><%=status%> Requests </b>  
<%} else {%> <br><b><%=status%> Requests </b> <%}}%>
</center></font><BR> <FONT SIZE="" COLOR="red">*Click checkboxes to hide/unhide required columns</FONT> </p>
</div>
<div id='data-container'>
<% 
<table class='data1' id='headerTable'  border=2 cellpadding="8">
<tbody>
<tr style="font-weight:bold;text-align:center" bgcolor="#C0C0C0">  
<th wrap> Req. No. </th><th nowrap> Req. Date </th><th wrap>  Work Order  </th> <th wrap> Project </th><th >  Req. Dept. / Req User  </th> <th > Aggregate </th> <th wrap> Domain </th> <th wrap>   Analysis Type   </th> <th wrap> Related Info. </th> <th wrap> Analyst </th> <th wrap> Accepted F/B Date </th><th wrap> Project Status </th> <th wrap> 1st Intermiediate F/B Date </th> <th wrap> FIR Completion Date </th> <th > FIR No. </th> <th wrap> Related Files </th>
</tr>
<%rs=stmt.executeQuery("select * from Requests where Status='"+status+"' order by Req_No");
while(rs.next()) { 
String st=rs.getString(22);
String r=rs.getString(1);
java.sql.Date reqdate=rs.getDate(5);
String req_date=df.format(reqdate);
username=rs.getString(16);
java.sql.Date accdate=rs.getDate(23);
acc_date=df.format(accdate);
rs1=stmt1.executeQuery("select Name from Team where Req_No='"+r+"'");  %>

<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=<%=r%>" target=_blank><%=r%></a></td> <td nowrap><%=req_date%></td>
<%=rs.getString(3)%></td> <td wrap ><%=rs.getString(2)%></td> 
<td wrap><%=rs.getString(4)%> / <%=username%></td> <td wrap><%=rs.getString(6)%></td>
<td wrap><%=rs.getString(7)%></td> <td wrap width="10%"><%=rs.getString(8)%></td> <td wrap><%=rs.getString(9)%></td>
<td ><%cnt=0;
  while(rs1.next())  { cnt++;
   team=rs1.getString(1);
if(team.equals("")) { out.println(""); }
else {out.println(team+",");}  }
rs1.close();
if(cnt==0) { out.println("None"); }%></td>
<td nowrap><%=acc_date%></td> <td ><%=rs.getString(10)%></td>
<td nowrap>  <% IFdate="null"; 
rs3=stmt3.executeQuery("select Date from Intermediate_Feedback where  FNo=1 AND Req_No="+r);
while(rs3.next()) {
  java.sql.Date ifdate=rs3.getDate(1);
  IFdate=df.format(ifdate);
}
rs3.close();
if(IFdate.equals("null"))
{%>-- <%}
else {%> <%=IFdate%> <%}%></td>
<td nowrap> <% compdate="";
firno="";
rs3=stmt3.executeQuery("select DateOfComp,FIR_No from FIR_Data where Req_No="+r);
while(rs3.next()){
java.sql.Date cdate=rs3.getDate(1);
compdate=df.format(cdate);
firno=rs3.getString(2);
}
rs3.close();
if(compdate.equals("")) {%> -- <%}
else {%> <%=compdate%>
<%if(firno.equals("")) {%> None<%} else {%> <%//=firno%><a href="#null" onclick='window.open("ViewReport.jsp?reqno=<%=r%>&dir=<%=firno%>","","menubar=0,toolbar=1,resizable=1") '><%=firno%></a><%}%>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=<%=r%>&st=<%=st%>","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<%    }//end of while   
rs.close();   %>
</tbody>
</table>
<% }%>
</div>
<% }catch(Exception e){}
    }%>
</BODY>
</HTML>



I'm not able to see the fixed header when I'm implementing this file.
Ihave chaged the table class names in xthf-sep.css to proper  name also.
Please tell.

Last edited by rudranee (June 4, 2010 6:09:23 am)


Rudranee

Offline

 

#3 June 5, 2010 10:02:43 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

Hi rudranee, Welcome to the forums!

Is the page available online somewhere? For debugging it would be good to see the "output" of the above jsp.

Offline

 

#4 June 7, 2010 12:33:39 am

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Sorry it is on compnay internal website.
Since Iam vry weak in java script and CSS it is being quite difficult for me to debug it.
Any suggestions please.


Rudranee

Offline

 

#5 June 7, 2010 1:38:14 am

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Instead of using xthf-sep.css I have linked to xthf-col.css.
But still I dont see any results.
So the external files are: x.js,xtableheaderfixed.js,xthf-xlib1.js,xthf-col.css.
Also I dont want double verticle scroll-bars for my table as the table is very big table.
Which .css file and funtion should I use for this?

Last edited by rudranee (June 7, 2010 3:09:04 am)


Rudranee

Offline

 

#6 June 7, 2010 6:33:00 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

Load your test page into a browser, then "view source", then copy it and paste it in a code post here.

Offline

 

#7 June 8, 2010 3:13:29 am

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Here is the code: I'm using JSp with HTML,CSS and javascript.

<script language=javascript>
//Disable right mouse click Script
var message="Function Disabled Due To Security Reasons!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
</script>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<HTML>
<HEAD>
<TITLE> First Investigation Report</TITLE>
</HEAD>
<BODY >
<TABLE>
<TR bgcolor="white">
<TD ><center><img src="./images/One.gif" width=200 height=150></center><TD>
<TD ><IMG SRC="./images/3.jpg"  ></TD>
<TD ><Font color="#4682B4" size=4>
<script language="JavaScript" > 
var now = new Date();
var months = new Array(
'January','February','March','April','May',
'June','July','August','September','October',
'November','December');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number)  {
 return (number < 1000) ? number + 1900 : number;}
today =  months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear()));
document.write(today);
</script>  </TD>
</TR>
<TR>
<TD colspan=1%></TD>
<TD colspan=2% ><br><center><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<style type="text/css">
<!--
/* The "clearFix" class is used for clearing the main menu items because they
   are left-floated for horizontal main menus and we have to clear them if our main
   menu is relatively positioned (as in this example) so that the main menu box
   takes its place correctly on the page. We have to apply this class to the parent
   DIV of the root UL of our menu tree. Please take a look at section 6.1 in the
   SmartMenus User's Manual for a detailed explanation if you like. */

.clearFix:after { /* for modern browsers */
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
.clearFix { /* for IE7/Win */
    min-height:1px;
}
* html .clearFix { /* for IE5-6/Win */
    height:1px;
}
* html>body .clearFix { /* for IE5/Mac */
    height:auto;
    display:inline-block;
}
-->
</style>
<!-- SmartMenus 6 config and script core files -->
<script type="text/javascript" src="c_config.js"></script>
<script type="text/javascript" src="c_smartmenus.js"></script>
<!-- SmartMenus 6 config and script core files -->

</head>

<body style="margin:0;padding:2em;padding-right:0;color:#000;">

<!-- Sample menu definition -->
<div class="clearFix" style="width:710px;padding:2;background:#FFFFFF;border:4px solid;border-color:#55A1FF;">
<ul id="Menu1" class="MM">
  <li><a href="./Home.jsp"> Home </a></li>
  <li><a class="NOLINK"> Your Requests </a>
  <ul>
   <li><a href="./AddNewReq.jsp?D=&Agg1=" target=_blank>Add New Request</a></li>
   <li><a href="./ViewReq.jsp?status=All">All Requests</a></li>
   <li><a href="./ViewReq.jsp?status=Pending">Pending Requests</a></li>
   <li><a href="./ViewReq.jsp?status=WIP">WIP Requests</a></li>
<li><a href="./ViewReq.jsp?status=For Approval">For Approval Requests</a></li>
 <li><a href="./ViewReq.jsp?status=Released">ALL Released Requests</a></li>
 <li><a href="./Search.jsp">Search Requests</a></li>
 <li><a href="http://128.9.14.220:7001/login.jsp" target="_blank">Old Requests</a></li>
 </ul>
  </li>
  
<li><a class="NOLINK">Uploads</a>
 <ul>
 <li><a href="./IFUpload.jsp"> Intermidiate Feedback</a></li>
 <li><a href="./ReportUpload.jsp"> Upload Final Report </a></li>
</ul>
</li>
<li><a class="NOLINK">Downloads</a>
<ul>
 <li><a href="./Download.jsp"> Feedback Templates</a></li>
</ul>
 </li>
<li><a class="NOLINK">MRS</a>
    <ul>
      <li><a href="#null" onclick='window.open("./MRS.html")'> MRS</a></li>
      </ul>
  </li>
 <li><a class="NOLINK">Misc</a>
 <ul>
  <li><a class="NOLINK">Administration</a>
<ul>
<li><a href="./AddNewUser.jsp"> Add New User </a></li>
<li><a href="./AddDept.jsp"> Add Department </a></li>
<li><a href="./AddWorkOrder.jsp"> Add Work Order </a></li>
<li><a href="./AddProject.jsp"> Add Project </a></li>
<li><a href="./AddAggregate.jsp"> Add Aggregate </a></li>
<li><a href="./AddAnalysisType.jsp"> Add Analysis Type</a></li>
<li><a href="./AddReason.jsp"> Add Reason For Analysis </a></li>
<li><a href="./AddTestSpec.jsp"> Add Std. Test Spec. </a></li>
<li><a href="./AddNonStdTest.jsp"> Add Non-Std. Test Spec </a></li>
<li><a href="./AddSpecialTest.jsp"> Add Special Test Spec </a></li>
</ul>
</li>
 <li><a href="./Methodology/Methodologies.jsp" target=_blank> Methodologies </a></li>
 <li><a href="./WorkOrders.jsp"> Work Order List</a></li>
<li><a href="./Change_pswd.jsp"> Change Password </a></li>
<li><a href="./Query.jsp"> Query </a></li>
</ul>
</li>
  <li class="NOSEPARATOR"><a href="logout.jsp">   Logout</a></li>
</ul>

</div>
<!-- Please leave at least one new line or white space symbol after the closing </ul>
     tag of the root ul element of the menu tree. This will allow the browsers to init
     the menu tree as soon as it is loaded and not wait for the page load event. -->
</body>
</html></center></TD>
        <TD colspan=5%></TD>
      </TR>
  </TABLE>
</BODY>
</HTML>
<!-- <script type='text/javascript' src='./X_library/offline.js'></script> -->
<script type='text/javascript' src='./X_library/x/x.js'></script>
<script type='text/javascript' src='./X_library/x/lib/xtableheaderfixed.js'></script>
<link rel='stylesheet' type='text/css' href='./X_library/x/examples/xthf-col.css'>
<script type='text/javascript' src='./X_library/x/examples/xthf1-xlib.js'></script>
<script type='text/javascript'>
xAddEventListener(window, 'load',
  function() {
    new xTableHeaderFixed('xthf-site', 'data-container');
  }, false
);
</script>
</head>
<body>
<FORM action="./FIR_Req.jsp" method="post">
 <div id='topcontent'>
<p><font size=6 color="#A52A2A" type="Verdana"><center>
 <b>For Approval Requests </b> 
</center></font><FONT SIZE="" COLOR="red">*Click checkboxes to hide/unhide required columns</FONT> </p>
</div>
<div id='data-container'>
<table class='data1' id='headerTable'  border=2 cellpadding="3">
<tbody>
<tr style="font-weight:bold;text-align:center" bgcolor="#C0C0C0">  
<th wrap> Req. No. </th><th nowrap> Req. Date </th><th wrap>  Work Order  </th> <th wrap> Project </th><th >  Req. Dept. / Req User  </th> <th > Aggregate </th> <th wrap> Domain </th> <th wrap>   Analysis Type   </th> <th wrap> Related Info. </th> <th wrap> Analyst </th> <th wrap> Accepted F/B Date </th><th wrap> Project Status </th> <th wrap> 1st Intermiediate F/B Date </th> <th wrap> FIR Completion Date </th> <th > FIR No. </th> <th wrap> Related Files </th>
</tr>
    
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=4684" target=_blank>4684</a></td> <td nowrap>18-Jul-09</td>
<td >EC031</td> <td wrap >Y1</td> 
<td wrap>ERCTRN / Vaseem momin</td> <td wrap>Grp 33, 35, 39 (Axles)</td>
<td wrap>Durability</td> <td wrap width="10%">Static Stiffness of axle components,Static Strength/Service Load Analysis of axle mponents,Optimization of axle components,</td> <td wrap>NA</td>
<td >Kiran.Karale,
Ramachandra Rao,
</td>
            <td nowrap>20-Jul-09</td> <td >DR2</td>
            <td nowrap>
              --
                </td>
            
            <td nowrap>  25-May-10
                  </td>
            <td >
               <a href="#null" onclick='window.open("ViewReport.jsp?reqno=4684&dir=ERCCAD/DURABILITY/Y1/2009/4684","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/Y1/2009/4684</a>
            </td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=4684&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=5118" target=_blank>5118</a></td> <td nowrap>23-Nov-09</td>
<td >EP036</td> <td wrap >Eng_Nano_family</td> 
<td wrap>ERCENG / chaitanya Kulkarni</td> <td wrap>Grp 01, 03, 05 (Engine/Drive_parts/Engine_timing)</td>
<td wrap>Durability</td> <td wrap width="10%">Factor-of-safety estimation for connecting rod,</td> <td wrap>Fracture Splitting Design</td>
<td >Prashant Kulkarni,S.S.Patil,</td>
<td nowrap>30Nov-09</td> <td >DR4</td>
<td nowrap>--<td nowrap> 26-May-10</td  <td > <a href="#null" onclick='window.open("ViewReport.jsp?5118&dir=ERCCAD/DURABILITY/Eng_Nano_family/2010/5118","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/Eng_Nano_family/2010/5118</a> </td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=5118&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<td ><a href="ShowRequests.jsp?req=5179" target=_blank>5179</a></td> <td nowrap>08-Dec-09</td>
td >EC031</td> <td wrap >Y1</td> 
<td wrap>ERCCAD / ramachandrarao.chappa</td> <td wrap>Grp 70 (Loadbody)</td>
<td wrap>Durability</td> <td wrap width="10%">Static Strength/Service Load Analysis of loadbody,,</td> <td wrap>NA</td>
<td >Kiran.Karale,Ramachandra Rao, </td>
<td nowrap>12-Dec-09</td> <td >DR2</td>
<td nowrap> -- </td>  <td nowrap>  26-May-10 </td>
<td > <a href="#null" onclick='window.open("ViewReport.jsp?reqno=5179&dir=ERCCAD/DURABILITY/Y1/2010/5179","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/Y1/2010/5179</a>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=5179&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
 ><a href="ShowRequests.jsp?req=5237" target=_blank>5237</a></td> <td nowrap>30-Dec-09</td>
<td >EA145</td> <td wrap >Busses</td> 
<td wrap>ERCHCV / Yogesh Adatiya</td> <td wrap>Aggregate mountings (battery/powertrain/etc.)</td>
<td wrap>Durability</td> <td wrap width="10%">Static Strength evaluation of powertrain mounting,</td> <td wrap>NA</td>
<td >Kaustubha Bhinge,Kiran.Karale,</td>
<td nowrap>02-Jan-10</td> <td >DR2</td>
<td nowrap>qno=5237&dir=ERCCAD/DURABILITY/Busses/2010/5237","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/Busses/2010/5237</a>
</td>
td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=5237&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td></tr>
<td wrap>ERCVII / Manjiree Sharma</td> <td wrap>Grp 31 (Frame/subframe)</td>
<td wrap>Durability</td> <td wrap width="10%">Static Strength/Service Load Analysis of frame,</td> <td wrap>NA</td>
<td >Prashant Kulkarni, S.S.Patil,</td>
<td nowrap>10-Feb-10</td> <td >DR4</td>
<td nowrap> -- </td>
<td nowrap>  26-May-10 </td>
<td ><a href="#null" onclick='window.open("ViewReport.jsp?reqno=5295&dir=ERCCAD/DURABILITY/SUMO/2010/5295","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/SUMO/2010/5295</a><td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=5295&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tbody>
</table>
/div>
</BODY>
</HTML>

Last edited by rudranee (June 8, 2010 3:14:43 am)


Rudranee

Offline

 

#8 June 8, 2010 9:30:16 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

There are two doctypes, two html elements, two body elements, etc. And there should only be one each of those. It looks like this line: <%@ include file="./header.html"%> is including a complete html document. Using an html validator will be helpful in this situation.

Offline

 

#9 June 10, 2010 12:07:36 am

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

<%@ include file="./header.html"%> is loads another html page for showing the tab menu of my site hence there are two html tags, etc.
Is that effecting the functioning of X-library in any way?


Rudranee

Offline

 

#10 June 10, 2010 11:23:01 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

It makes the page invalid. There should only be one each of those elements in the entire page.

Offline

 

#11 June 10, 2010 11:34:10 pm

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Ok. But then what is the alternative for this?
In every page of my site I have to include the header images which are set in htm page, my site menu which is coded in a JSP page, these both pages have to be included on every page and they do contain html tags.


Rudranee

Offline

 

#12 June 11, 2010 11:46:29 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

The file "header.html" should only contain what is currently in its <body> element. As for the style and script elements in that file, you can just put them at the top of that file - or you could have them in separate files and "include" them in the <head> element of your main document. Of course, there are different ways of organizing these three things (style, script, html), this is only a suggestion. I have taken the code in your last code-post and made a "header.html" per this suggestion.

<style type="text/css">
/* The "clearFix" class is used for clearing the main menu items because they
   are left-floated for horizontal main menus and we have to clear them if our main
   menu is relatively positioned (as in this example) so that the main menu box
   takes its place correctly on the page. We have to apply this class to the parent
   DIV of the root UL of our menu tree. Please take a look at section 6.1 in the
   SmartMenus User's Manual for a detailed explanation if you like. */

.clearFix:after { /* for modern browsers */
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
.clearFix { /* for IE7/Win */
    min-height:1px;
}
* html .clearFix { /* for IE5-6/Win */
    height:1px;
}
* html>body .clearFix { /* for IE5/Mac */
    height:auto;
    display:inline-block;
}
</style>

<!-- SmartMenus 6 config and script core files -->
<script type="text/javascript" src="c_config.js"></script>
<script type="text/javascript" src="c_smartmenus.js"></script>
<!-- SmartMenus 6 config and script core files -->

<!-- Sample menu definition -->
<div class="clearFix" style="width:710px;padding:2;background:#FFFFFF;border:4px solid;border-color:#55A1FF;">
<ul id="Menu1" class="MM">
  <li><a href="./Home.jsp"> Home </a></li>
  <li><a class="NOLINK"> Your Requests </a>
  <ul>
   <li><a href="./AddNewReq.jsp?D=&Agg1=" target=_blank>Add New Request</a></li>
   <li><a href="./ViewReq.jsp?status=All">All Requests</a></li>
   <li><a href="./ViewReq.jsp?status=Pending">Pending Requests</a></li>
   <li><a href="./ViewReq.jsp?status=WIP">WIP Requests</a></li>
<li><a href="./ViewReq.jsp?status=For Approval">For Approval Requests</a></li>
 <li><a href="./ViewReq.jsp?status=Released">ALL Released Requests</a></li>
 <li><a href="./Search.jsp">Search Requests</a></li>
 <li><a href="http://128.9.14.220:7001/login.jsp" target="_blank">Old Requests</a></li>
 </ul>
  </li>
  
<li><a class="NOLINK">Uploads</a>
 <ul>
 <li><a href="./IFUpload.jsp"> Intermidiate Feedback</a></li>
 <li><a href="./ReportUpload.jsp"> Upload Final Report </a></li>
</ul>
</li>
<li><a class="NOLINK">Downloads</a>
<ul>
 <li><a href="./Download.jsp"> Feedback Templates</a></li>
</ul>
 </li>
<li><a class="NOLINK">MRS</a>
    <ul>
      <li><a href="#null" onclick='window.open("./MRS.html")'> MRS</a></li>
      </ul>
  </li>
 <li><a class="NOLINK">Misc</a>
 <ul>
  <li><a class="NOLINK">Administration</a>
<ul>
<li><a href="./AddNewUser.jsp"> Add New User </a></li>
<li><a href="./AddDept.jsp"> Add Department </a></li>
<li><a href="./AddWorkOrder.jsp"> Add Work Order </a></li>
<li><a href="./AddProject.jsp"> Add Project </a></li>
<li><a href="./AddAggregate.jsp"> Add Aggregate </a></li>
<li><a href="./AddAnalysisType.jsp"> Add Analysis Type</a></li>
<li><a href="./AddReason.jsp"> Add Reason For Analysis </a></li>
<li><a href="./AddTestSpec.jsp"> Add Std. Test Spec. </a></li>
<li><a href="./AddNonStdTest.jsp"> Add Non-Std. Test Spec </a></li>
<li><a href="./AddSpecialTest.jsp"> Add Special Test Spec </a></li>
</ul>
</li>
 <li><a href="./Methodology/Methodologies.jsp" target=_blank> Methodologies </a></li>
 <li><a href="./WorkOrders.jsp"> Work Order List</a></li>
<li><a href="./Change_pswd.jsp"> Change Password </a></li>
<li><a href="./Query.jsp"> Query </a></li>
</ul>
</li>
  <li class="NOSEPARATOR"><a href="logout.jsp">   Logout</a></li>
</ul>

</div>
<!-- Please leave at least one new line or white space symbol after the closing </ul>
     tag of the root ul element of the menu tree. This will allow the browsers to init
     the menu tree as soon as it is loaded and not wait for the page load event. -->



One more suggestion... I notice you have a script element prior to the doctype (the rightclick disable script). Ideally this should be in the <head> element of the main document (it could be "included"). But, it "might" be ok as it is.

Offline

 

#13 June 11, 2010 12:32:51 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

I notice that your main page is using an "HTML 4.0 Transitional" doctype. This will trigger "quirks mode" in most browsers. All of my Javascript demos will perform better when the browser is in "standards" mode. You could use...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
or an html5 doctype...
<!DOCTYPE html>
...but note that this may change how some elements are rendered. For reference see:
wikipedia / Quirks Mode
Activating Browser Modes with Doctype

Offline

 

#14 June 12, 2010 5:44:43 am

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Hi,
I did implement the changes you suggested in my pages, now the code is as below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<HTML>
<head>
<script language=javascript>
//Disable right mouse click Script
//For full source code, visit http://www.dynamicdrive.com
var message="Function Disabled Due To Security Reasons!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
</script>

</HEAD>
<BODY > 
<TABLE>
<TR bgcolor="white">
<TD ><center><img src="./images/One.gif" width=200 height=150></center><TD>
<TD ><IMG SRC="./images/3.jpg"  ></TD>
<TD ><Font color="#4682B4" size=4>
<script language="JavaScript" > 
var now = new Date();
  var months = new Array(
      'January','February','March','April','May',
      'June','July','August','September','October',
      'November','December');
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
    function fourdigits(number)  {
      return (number < 1000) ? number + 1900 : number;}
   today =  months[now.getMonth()] + " " +
    date + ", " +
    (fourdigits(now.getYear()));
  document.write(today);
</script>      </TD>
</TR>
<TR>
<TD colspan=1%></TD>
<TD colspan=2% ><br><center>
<style type="text/css">
<!--
/* The "clearFix" class is used for clearing the main menu items because they
   are left-floated for horizontal main menus and we have to clear them if our main
   menu is relatively positioned (as in this example) so that the main menu box
   takes its place correctly on the page. We have to apply this class to the parent
   DIV of the root UL of our menu tree. Please take a look at section 6.1 in the
   SmartMenus User's Manual for a detailed explanation if you like. */

.clearFix:after { /* for modern browsers */
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
.clearFix { /* for IE7/Win */
    min-height:1px;
}
* html .clearFix { /* for IE5-6/Win */
    height:1px;
}
* html>body .clearFix { /* for IE5/Mac */
    height:auto;
    display:inline-block;
}
-->
</style>
<!-- SmartMenus 6 config and script core files -->
<script type="text/javascript" src="c_config.js"></script>
<script type="text/javascript" src="c_smartmenus.js"></script>
<!-- SmartMenus 6 config and script core files -->


<!-- Sample menu definition -->
<div class="clearFix" style="width:710px;padding:2;background:#FFFFFF;border:4px solid;border-color:#55A1FF;">
<ul id="Menu1" class="MM">
  <li><a href="./Home.jsp"> Home </a></li>
  
  <li><a class="NOLINK"> Your Requests </a>
    <ul>
      <li><a href="./AddNewReq.jsp?D=&Agg1=" target=_blank>Add New Request</a></li>
      <li><a href="./ViewReq.jsp?status=All">All Requests</a></li>
      <li><a href="./ViewReq.jsp?status=Pending">Pending Requests</a></li>
      <li><a href="./ViewReq.jsp?status=WIP">WIP Requests</a></li>
<li><a href="./ViewReq.jsp?status=For Approval">For Approval Requests</a></li>
    <li><a href="./ViewReq.jsp?status=Released">ALL Released Requests</a></li>
    <li><a href="./Search.jsp">Search Requests</a></li>
     <li><a href="http://128.9.14.220:7001/login.jsp" target="_blank">Old Requests</a></li>
    </ul>
  </li>
  
  <li><a class="NOLINK">Uploads</a>
    <ul>
      <li><a href="./IFUpload.jsp"> Intermidiate Feedback</a></li>
      <li><a href="./ReportUpload.jsp"> Upload Final Report </a></li>
      </ul>
  </li>
  
  <li><a class="NOLINK">Downloads</a>
    <ul>
      <li><a href="./Download.jsp"> Feedback Templates</a></li>
      </ul>
  </li>
<li><a class="NOLINK">MRS</a>
    <ul>
      <li><a href="#null" onclick='window.open("./MRS.html")'> MRS</a></li>
      </ul>
  </li>

  <li><a class="NOLINK">Misc</a>
    <ul>
<li><a class="NOLINK">Administration</a>
<ul>
<li><a href="./AddNewUser.jsp"> Add New User </a></li>
<li><a href="./AddDept.jsp"> Add Department </a></li>
<li><a href="./AddWorkOrder.jsp"> Add Work Order </a></li>
<li><a href="./AddProject.jsp"> Add Project </a></li>
<li><a href="./AddAggregate.jsp"> Add Aggregate </a></li>
<li><a href="./AddAnalysisType.jsp"> Add Analysis Type</a></li>
<li><a href="./AddReason.jsp"> Add Reason For Analysis </a></li>
<li><a href="./AddTestSpec.jsp"> Add Std. Test Spec. </a></li>
<li><a href="./AddNonStdTest.jsp"> Add Non-Std. Test Spec </a></li>
<li><a href="./AddSpecialTest.jsp"> Add Special Test Spec </a></li>
</ul>
</li>
 <li><a href="./Methodology/Methodologies.jsp" target=_blank> Methodologies </a></li>
 <li><a href="./WorkOrders.jsp"> Work Order List</a></li>
<li><a href="./Change_pswd.jsp"> Change Password </a></li>
 <li><a href="./Query.jsp"> Query </a></li>
</ul>
 </li>
  <li class="NOSEPARATOR"><a href="logout.jsp">   Logout</a></li>
</ul>
</div>
<!-- Please leave at least one new line or white space symbol after the closing </ul>
     tag of the root ul element of the menu tree. This will allow the browsers to init
     the menu tree as soon as it is loaded and not wait for the page load event. -->
</center></TD>
<TD colspan=5%></TD>
</TR>
</TABLE>
<!-- <script type='text/javascript' src='./X_library/offline.js'></script> -->
<script type='text/javascript' src='./X_library/x/x.js'></script>
<script type='text/javascript' src='./X_library/x/lib/xtableheaderfixed.js'></script>
<link rel='stylesheet' type='text/css' href='./X_library/x/examples/xthf-col.css'>
<script type='text/javascript' src='./X_library/x/examples/xthf1-xlib.js'></script>
<script type='text/javascript'>
xAddEventListener(window, 'load',
  function() {
    new xTableHeaderFixed('xthf-site', 'data-container');
  }, false
);
</script>
<FORM action="./FIR_Req.jsp" method="post">
 <div id='topcontent'>
 <p><font size=6 color="#A52A2A" type="Verdana"><center>
 <b>For Approval Requests </b> 
</center></font><FONT SIZE="" COLOR="red">*Click checkboxes to hide/unhide required columns</FONT> </p>
</div>
<div id='data-container'>
<table class='data1' id='headerTable'  border=2 cellpadding="3">
<tbody>
<tr style="font-weight:bold;text-align:center" bgcolor="#C0C0C0">  
<th wrap> Req. No. </th><th nowrap> Req. Date </th><th wrap>  Work Order  </th> <th wrap> Project </th><th >  Req. Dept. / Req User  </th> <th > Aggregate </th> <th wrap> Domain </th> <th wrap>   Analysis Type   </th> <th wrap> Related Info. </th> <th wrap> Analyst </th> <th wrap> Accepted F/B Date </th><th wrap> Project Status </th> <th wrap> 1st Intermiediate F/B Date </th> <th wrap> FIR Completion Date </th> <th > FIR No. </th> <th wrap> Related Files </th>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=4394" target=_blank>4394</a></td> <td nowrap>24-Apr-09</td>
<td >EA103</td> <td wrap >HCV</td> 
<td wrap>ERCHCV / Sandip Mane</td> <td wrap>Group 46 (Steering)</td>
<td wrap>Durability</td> <td wrap width="10%">Static strength/stiffness analysis of steering system components,</td> <td wrap>Steering gear box mounting bracket failure at cowl</td>
<td >Ajit More,
</td>
<td nowrap>24-May-09</td> <td >DR3</td>
<td nowrap> -- </td>
<td nowrap>  11-Jun-10 </td>
<td > <a href="#null" onclick='window.open("ViewReport.jsp?reqno=4394&dir=ERCCAD/DURABILITY/HCV/2009/4394","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/HCV/2009/4394</a>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=4394&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=4394" target=_blank>4394</a></td> <td nowrap>24-Apr-09</td>
<td >EA103</td> <td wrap >HCV</td> 
<td wrap>ERCHCV / Sandip Mane</td> <td wrap>Group 46 (Steering)</td>
<td wrap>Durability</td> <td wrap width="10%">Static strength/stiffness analysis of steering system components,</td> <td wrap>Steering gear box mounting bracket failure at cowl</td>
<td >Ajit More,
</td>
<td nowrap>24-May-09</td> <td >DR3</td>
<td nowrap> -- </td>
<td nowrap>  11-Jun-10 </td>
<td > <a href="#null" onclick='window.open("ViewReport.jsp?reqno=4394&dir=ERCCAD/DURABILITY/HCV/2009/4394","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/HCV/2009/4394</a>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=4394&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=4394" target=_blank>4394</a></td> <td nowrap>24-Apr-09</td>
<td >EA103</td> <td wrap >HCV</td> 
<td wrap>ERCHCV / Sandip Mane</td> <td wrap>Group 46 (Steering)</td>
<td wrap>Durability</td> <td wrap width="10%">Static strength/stiffness analysis of steering system components,</td> <td wrap>Steering gear box mounting bracket failure at cowl</td>
<td >Ajit More,
</td>
<td nowrap>24-May-09</td> <td >DR3</td>
<td nowrap> -- </td>
<td nowrap>  11-Jun-10 </td>
<td > <a href="#null" onclick='window.open("ViewReport.jsp?reqno=4394&dir=ERCCAD/DURABILITY/HCV/2009/4394","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/HCV/2009/4394</a>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=4394&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=4394" target=_blank>4394</a></td> <td nowrap>24-Apr-09</td>
<td >EA103</td> <td wrap >HCV</td> 
<td wrap>ERCHCV / Sandip Mane</td> <td wrap>Group 46 (Steering)</td>
<td wrap>Durability</td> <td wrap width="10%">Static strength/stiffness analysis of steering system components,</td> <td wrap>Steering gear box mounting bracket failure at cowl</td>
<td >Ajit More,
</td>
<td nowrap>24-May-09</td> <td >DR3</td>
<td nowrap> -- </td>
<td nowrap>  11-Jun-10 </td>
<td > <a href="#null" onclick='window.open("ViewReport.jsp?reqno=4394&dir=ERCCAD/DURABILITY/HCV/2009/4394","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/HCV/2009/4394</a>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=4394&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
<tr style="text-align:center" bgcolor="#D1D1D1">
<td ><a href="ShowRequests.jsp?req=4394" target=_blank>4394</a></td> <td nowrap>24-Apr-09</td>
<td >EA103</td> <td wrap >HCV</td> 
<td wrap>ERCHCV / Sandip Mane</td> <td wrap>Group 46 (Steering)</td>
<td wrap>Durability</td> <td wrap width="10%">Static strength/stiffness analysis of steering system components,</td> <td wrap>Steering gear box mounting bracket failure at cowl</td>
<td >Ajit More,
</td>
<td nowrap>24-May-09</td> <td >DR3</td>
<td nowrap> -- </td>
<td nowrap>  11-Jun-10 </td>
<td > <a href="#null" onclick='window.open("ViewReport.jsp?reqno=4394&dir=ERCCAD/DURABILITY/HCV/2009/4394","","menubar=0,toolbar=1,resizable=1") '>ERCCAD/DURABILITY/HCV/2009/4394</a>
</td>
<td ><a href="#null" onclick='window.open("ViewFiles.jsp?dir=4394&st=For Approval","","menubar=0,toolbar=1,resizable=1") '>Input Files</a></td>
</tr>
</tbody>
</table>
</div>
</BODY>
</HTML>



But still the table header is not remaining fixed.


Rudranee

Offline

 

#15 June 12, 2010 9:39:00 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: X library and JSP

Suggestions/comments...

1. Use an html validator

2. Don't use an xhtml doctype - use one of the doctypes I suggested above.

3. In your first post you mention XColHide - X doesn't have a function by that name so I assume you mean xTableColDisplay. xTableHeaderFixed will probably not work with that without modifications.

4. Your table doesn't have a thead section.

5. Use xtableheaderfixed.js and x.js, or use xthf1-xlib.js, but not all three.

6. In one of your previous posts you said "Also I dont want double verticle scroll-bars for my table as the table is very big table.", but I don't know what you mean by that. Do you want this to be like my Demo 5? If so, it won't work if the table is wider than the its container (I never got around to adding support for that). For your table I suggest you use Demo 4, where the container is the window object.

7. xTableHeaderFixed is one of my more complicated scripts to implement. It is difficult to get it to work cross-browser and it is extremely dependent on the html and css being done just right. I suggest you start with a copy of the Demo 4 page, get it working on your site, then adapt it to your site's layout and style, then adapt the table to your own.

Offline

 

#16 June 13, 2010 11:21:26 pm

rudranee
New Member
Registered: June 3, 2010
Posts: 9

Re: X library and JSP

Thankx for your help and valuable suggestions.
I would see how this workd out.


Rudranee

Offline

 

Board footer

Powered by PunBB 1.2.15
Copyright © 2002–2005 Rickard Andersson

Expand Restore Select Format Eval Load