Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JSP - Servlet related question - Request Help

Reply
Thread Tools

JSP - Servlet related question - Request Help

 
 
Daku
Guest
Posts: n/a
 
      03-23-2010
Could some Java guru please help ? I have a JSP, which calls a
Servlet, which in turn does some database queries, and then generates
a
Web page, in its 'doGet' method, and displays the retreived data. The
retreived data is displayed as a set of checkboxes with suitable
labels and all. By seelcting appropriate checkboxes, and clicking on a
button, the user
adds the selected item to another list. I was
wondering if there is a way to achieve the same something like the
following - the user simply passes the mouse over the items he/she
wants (no checking of checkboxes) and the items get selected. Any
hints, suggestions would be of immense value. Thanks in advance fro
your help.
 
Reply With Quote
 
 
 
 
Fingolfin
Guest
Posts: n/a
 
      03-23-2010
On 23.3.2010. 6:59, Daku wrote:
> Could some Java guru please help ? I have a JSP, which calls a
> Servlet, which in turn does some database queries, and then generates
> a
> Web page, in its 'doGet' method, and displays the retreived data. The
> retreived data is displayed as a set of checkboxes with suitable
> labels and all. By seelcting appropriate checkboxes, and clicking on a
> button, the user
> adds the selected item to another list. I was
> wondering if there is a way to achieve the same something like the
> following - the user simply passes the mouse over the items he/she
> wants (no checking of checkboxes) and the items get selected. Any
> hints, suggestions would be of immense value. Thanks in advance fro
> your help.


There are several methods checking checkboxes with JavaScript, here is one:

<p>Please select a sport that you like to play.</p>
Soccer: <input type="checkbox" name="sports" value="soccer"
onMouseover="if (!this.checked) { this.checked = true; } else {
this.checked = false; }" /><br />
Football: <input type="checkbox" name="sports" value="football"
onMouseover="if (!this.checked) { this.checked = true; } else {
this.checked = false; }" /><br />

You could put checking/unchecking in a separate function also, for that
instead of "this.checked = true;" you should place a function call that
passes a checkbox number and the function would be something like:
"form.sports[checkBox].checked=true".

But nevermind that, if you want to write the changes in the database as
you hover your mouse over these checkboxes (without clicking a button) I
believe you should use Ajax.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening new child window - Running servlet (JSP and Servlet) agapitolw@yahoo.es Java 4 08-27-2007 12:57 PM
JSP/Servlet performance related question itreflects@gmail.com Java 9 12-17-2006 05:43 AM
Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getOutputStream() has already been called for this response javadev Java 5 11-16-2006 11:22 AM
Getting servlet context path without a servlet request. stuart.j.wood@gmail.com Java 3 06-06-2006 06:38 AM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM



Advertisments