• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP+Checkbox - Urgent !!

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Friends,
I give below my coding.My requirement is as below.
I am generating a table with three columns and one column is having a hyperlink and another 2 columns have checkboxes.
Basically it is for the candidate profile.
So after clicking the hyperlink ,i will get the second page wherein i will get the candidate details.After going thro'the same i will come back to first screen,where against the candidate name i will select the options provided in the two check boxes.I will repeat the procedure for the next candidate.
But the problem is that when i go for the second candidate and view his profile and after coming to the first page ,the status of the first candidates becomes blank and it is not setting back to the original position.
In a nutshell my settings at the checkboxes for the first candidate should not get changed even after going to and from the
first page.
My problem is that i should not use javascript.
My coding:
<%@ page language="java" session="true"%>
<%@ page import="javax.servlet.*,javax.servlet.http.*,java.util.*, java.sql.*, java.io.*" %>
<html>
<head>
<title>New Candidates</title></head>
<body>
<%!
String req =" ";
String jid =" ";
String cid =" ";
String ca_title =" ";
String status =" ";
String action =" ";
int count = 0;

Connection con;
ResultSet rs;
Statement st;
String sql;

%>
<%
req = request.getParameter("ca_title");

jid = request.getParameter("jid");
status = request.getParameter("status");
action = request.getParameter("action");

cid = request.getParameter("cid");

%>
<input type="hidden" name="ca_title" value="<%=req%>">
<input type="hidden" name="cid" value="<%=cid%>">
<input type="hidden" name="jid" value="<%=jid%>">
<p>New Candidates</p>
<p>Project Managers</p>
<p>(Click name for Profile Summary</p>
<p>
<table>
<tr><td>Candidate Name </td>
<td>Status </td>
<td>Action</td>
</tr>
<%

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc dbc:info","shop","shop");
st = con.createStatement();
sql = "select candidateID,CAFirstName from candidate where catitle like '%"+req+"%'";
rs = st.executeQuery(sql);
while(rs.next())
{
String aa = rs.getString("candidateID");
String bb = rs.getString("CAFirstName");

%>
<tr><td><a href="http://localhost:8080/infodream/detail.jsp?cand_name=<%=bb.trim()%>&cand_id=<%=aa%>&jid=<%=jid%>&cid=<%=cid%>&ca_title=<%=req%>"><%=bb.tri m()%></td>
<td><SELECT name=status>
<OPTION value="<%=status%>" selected></OPTION>
<OPTION value=S>Selected</OPTION>
<OPTION value=R>Rejected</OPTION>
</SELECT><BR>
</td>
<td><SELECT name=action>
<OPTION value="<%=action%>" selected></OPTION>
<OPTION value=IWI>I Will Interview</OPTION>
<OPTION value=YS>You Screen</OPTION>
<OPTION value=C>Confirmed</OPTION>
</SELECT><BR>
</td>
</tr>

<%
}//while
}//try
catch(Exception e)
{
out.println("Exception "+e);
}
%>
</table><br><br><br><br><br>
<a href="http://localhost:8080/infodream/scrcandidates.html">Send</a>
<a href="http://localhost:8080/infodream/scrcandidates.html">Back</a>
<a href="http://localhost:8080/infodream/scrcandidates.html">Menu</a>
</p>

</body>
</html>
Please give your feedback.
Regards,
Ramamoorthy
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
After seeing or entering candidate details thro' hyper link, are u reloading the page or simply coming back? if u reload the first page(page contains hyperlink and check box), then already checked boxes will come as empty.if u use javascript(history.back), then pervious information won't lost..
 
Rama moorthy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Gopi,
Thanks for your reply.
As mentioned I CAN NOT USE JAVASCRIPT .Also i hv to reload the page.Can u explain any possibility of coming back to first page keeping the same status?
Regards,
Ramamoorthy
reply
    Bookmark Topic Watch Topic
  • New Topic