File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc 3 problem with buttons

 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To edit a Video, I used radiobuttons and ONE
submitbutton.
BUT we should use a button for each video to edit a video (and later a second one too for deleting) and now I need some help which type of button to use and how to relate it to the row of the video(description).
If all buttons are submit buttons, then one could use different names, but I think that the name is not one to one related to the rows in the database, meaning one needs some direct info about the video, right?
In the radiobuttons version I used the invisible value parameter to get info about the video meant (clicked one) and displayed it for editing.
Help is very much appreciated
Peter
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all buttons are submit buttons, then one could use different names, but I think that the name is not one to one related to the rows in the database,

You can pass the title as a hidden parameter ...
 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm...
Does this mean we need a table of 'forms' and not
a form containing a table (what I did)?
Indeed, in this case each form has a submit button and by a hidden parameter the video can be identified.
Nevertheless I would like to know why the radiobutton solution is rejected
(or the assigment could be more specific?).
For the last assignment it would be easy too:
Each video has (already) one radiobutton (to eventually select)
One SUBMIT button to trigger edit.
One SUBMIT button to trigger delete.
(Reset not needed because of the other buttons and/or reload)
Weeping: this is/was my already working solution
:roll: in june .
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A form containing a table is fine. Maybe you can use the parameters you had for your radio buttons but attach them to "Edit" buttons instead of radio buttons.


Assignment JDBC-3
Extend assignment JDBC-2 to include the ability to edit an existing video.

Modify the video list, so each video has an "edit" button. Allow the user to edit the video data and save it.


The requirements of the assignment require an edit button for each video.
 
Peter Gragert
Ranch Hand
Posts: 424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I 'found' a solution with an edit button .
I wonder if this is wat is expected so eagerly waiting until Marilyn has time to 'nitpick'.
For others: The problem is/was how the servlet can be told which Video is selected for editing.
A 'button' button ? No. I do/did not see how the called servlet can discover if the button was ever or never pressed.
So remains 'submit' button the value could be asked by the servlet but that is displayed and should be 'edit' shouldn't it? And a table of forms is not allowed which would make it possible to give info by an 'hidden' value of a suitable HTML-object .
Remains one 'inverse' possibility ( a little bit cryptic to not tell the whole story) which
at least works (though not as efficient as my earlier method with radio buttons )
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic