File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes help with methods in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "help with methods in jsp" Watch "help with methods in jsp" New topic

help with methods in jsp

Bashar Ayyash
Ranch Hand

Joined: Jun 24, 2004
Posts: 44
Hi guys,,,,

I need your help with my JSP page. I have a page which displays users details, from a database, in a table and beside each row there are two buttons (Delete and Submit). I successfully displayed the data in a table, but I didn't know how to make Delete button calls delete method and what to write in delete method(), the method will change the font style to line-through, and the row background to another color. The data won't be deleted from the DB but its style and background will change.

The submit button will copy the user details into the admin table in the DB and change the status of the row to Submitted.

Can anybody help me please?

Thanx in advance for any help you would provide.
[ January 18, 2006: Message edited by: Bear Bibeault ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

This kind of help is really beyond the scope of a users forum.

I would recommend finding some books on the technologies that are involved and spending some time reading them.
There is also a lot of information to be found on the web.

If you get stuck on a single issue, by all means, come on back and ask.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bashar Ayyash
Ranch Hand

Joined: Jun 24, 2004
Posts: 44
thank you for the info you provided I managed to delete the row, but can anybody help me with the submit button
[ January 18, 2006: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63871

What help do you need? Generally a submit button submits the form, which causes the backend processing to occur, and then the page gets refreshed with the new data.

[Asking smart questions] [About Bear] [Books by Bear]
Bashar Ayyash
Ranch Hand

Joined: Jun 24, 2004
Posts: 44
Bacause there are many submit buttons (Beside each row), how to get that row id and transfer it to the DB to SELECT all the details associated with that id.

I hope you got the idea.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You could use the onClick event in Javascript, passing the rowId to you function. This function will set the rowId into a hidden parameter of your form, then submit. You can then retrieve the rowId in the servlet from the hidden parameter. That's one way.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: help with methods in jsp
It's not a secret anymore!