Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pre-populating a struts form

 
N Nanda
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all... Kindly someone help me. I am using the same page to display the records from a database and a form in which i can add records.


Field 1 Field 2 Actions
-----------------------------------------
Value Value View | Edit | Delete
-----------------------------------------
Value Value View | Edit | Delete

.
.
.

Add a new Value...

<here lies my form>


Here View | Edit | Delete are all links. I want when I'll click on the Edit link, the data from that row must appear in the form below. Please Help me how to do it. Its an urgency.

Thanking you all in advance.

Niranjan Nanda
 
Shankar Narayana
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nanda,

what you can do when you click the Edit is (I assume you have entered the some value into some field to retrieve the record from the database) get the corresponding records from the database and populate the actionForm and return back to the jsp, your fields will be filled the values of that specific record.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic