Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need immediate help, my job is stuck

 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sorry to be late here, but i need an immediate help. I am new to struts and recently put into a struts project.

FYI

I have a jsp file, where I am getting values from SQL SERVER 2000 database using an Action Class and A Form Bean.
This jsp view is as a tabular format, where data is populated.
Selectbox text checkbox checkbox text text cancel_image

This page having operations like cancel_row / save_table / add_row

First : I need to populate the values from database to this jsp page during the opening of this page
Second : how can I add row to this table dynamically so that I can enter a few records and save the data to the database.
Third : When I save the records the values must go to ActionServlet, where I need them all in an ArrayList.

Kindly see the code below.

-Thanks & Regards,
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Immediate" help is unlikely, as this is a forum that people read at their leisure.

It's also a completely useless subject line: see here.

Without the use of code tags code is very difficult to read--particularly when there's that much of it. I'll try to read it, but I'm also suspicious that this much code was necessary to communicate the problem.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't actually state what problem(s) you're having. Are you unable to do one or more of the three things you list as the requirement?
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

I really understand, i did some stupid thins here. But i was quite confused with my work and i posted here in hurry. I will take care of this next time.

Yes, i am not sure what to do with this on this level. hope you can suggest me a solution.


-Thanks & Regards,
Kaushal Sharma
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A solution for what? You don't say what isn't working.

You can edit your post to include code tags, or re-post using them correctly.
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi David,

Kindly let me know how to post my code in the best fit?



-Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By following the link I gave you about code tags.

Here it is again:

http://faq.javaranch.com/java/UseCodeTags
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David for such a helpful information.

Here i go....

my JSP FIle,






My ActionServlet ....





My Form Bean....














hope you can provide me some help.



-Thanks & Regards,
Kaushal K. Sharma



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really not indent your code?!

Again: help with ***what***? What doesn't work?
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Actually i need get data from database to my jsp page that will be displayed in a form - tabular form. I have created the view and the first field with <select>


is working fine, similarly i need data for other fields.

Later, i need to do some operations on the jsp page like 'save', 'add field', 'delete', 'cancel'.

As you look into the jsp page every last column in the table is having an in image to delete the row with the data from the database. i am not sure how to do this...

i created a javascript function to add and delete the row but need to add records to the database when i click to 'save' button and delete the records from the database when i click on the 'cancel' image in last coulmn of every row. the add and delete fuctions are as given below,




i need to send data back to my ActionServlet in an arraylist.


Please suggest.


-Thanks & Regards,
Kaushal K. Sharma
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Are you there?



Please suggest me anyone.




-Thanks & Regards,
Kaushal K. Sharma
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see this.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have one field--why don't you have the rest? How are you sending the data to the JSP?

Do your JavaScript functions for adding/deleting rows work? Are you using indexed fields?

What version of Struts are you even using?
 
kaushal sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Yes, i used Indexed Fields.



-Thanks & Regards,
Kaushal K. Sharma


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You answered one question out of five :/

If you're using indexed fields, and your JavaScript works correctly, and your ActionForm is defined correctly, then I don't know what the problem is, and you don't want to tell us.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic