File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » JSP
Bookmark "help with methods in jsp" Watch "help with methods in jsp" New topic
Author

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
Sheriff

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.
http://www.google.com/search?hl=en&q=JSP+TUTORIAL&btnG=Google+Search
http://www.google.com/search?hl=en&lr=&q=HTML+TUTORIAL&btnG=Search
http://www.google.com/search?hl=en&lr=&q=JDBC+TUTORIAL&btnG=Search
http://www.google.com/search?hl=en&lr=&q=CSS+TUTORIAL&btnG=Search

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


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
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

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] [Bear's FrontMan] [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é
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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: http://aspose.com/file-tools
 
subject: help with methods in jsp