JavaRanch » Java Forums »
Java »
JSP
| Author |
set values in a table from other
|
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
Hi,
I have a jsp page in this page I have one static text field for current date and below this in dynamic table having one text box
and two radio buttons for present and absent. The main work of this page is that I am retriving staff_name from a table and want to be insert every perticular text field value(Staff name) in second table with their status absent OR present
so my question is how it is possible.. because I am facing an a problem the only one(first text field value) adding in the table ..
please give me some suggestion.............
Thanks!
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
Hey,
Without the code of how you are adding things to the table, there isn't really much we can say. Could you post it (remember and use the code tags).
Sean
|
I love this place!
|
 |
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
This is my first jsp page ............
This is second jsp.........
This is bean where I am inserting values ...
One thing staff_manager bean is also use in jsp for one field where i am getting staff_names
database is here....
please reply................
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
Hey, I think in your JSP you are starting a <tr> outside the loop therefore only the first row has a <tr> and </tr>. View the source and you should be able to see this.
Also it has to be said, in this day and age java code in JSP's is a big NO. For a start not having the java code there tidies up the HTML in your page in which case you would have been able to find your problem much easier as you can indent it as it should be!
Also doing this allows you to consolidate all your database access so you don't have to set up connections all over the place! There are so many good reasons for doing it, to not is a mistake.
Sean
|
 |
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
|
I ave cheked but not working..........
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
"It's not working" does not help, please can you post the source as it appears in your browser...
Sean
|
 |
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
How I can send You my browser page .....................
Please tell me.........
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
In IE, go to your page click View -> Source and copy that.
Sean
|
 |
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
This is source.............
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
Ok, I can't see any problems with that... but like I said I think it is because you are putting your <tr> start tag before getting the data from the database rather than on each row.
Sean
|
 |
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
I think all <tr> and <td>s are set at own place....................
please suggest me.........
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
look at your code, on line 7 you create the row before you start looping so only 1 row is ever created.
Sean
|
 |
Rd Dari
Ranch Hand
Joined: Feb 22, 2010
Posts: 194
|
|
Hi Sean ,
Thanks for reply but my code as it is as you posted but only first value is inserting in the table I could not understanding the problem...
please read all latest code I am posting and suggest me what should in this.......
Thanks!!!
This is bean file....
This is jsp page...
This is insertion page of jsp page
and these are tables.....
|
 |
 |
|
|
subject: set values in a table from other
|
|
|
|