aspose file tools*
The moose likes Cattle Drive and the fly likes jdbc 3 problem with buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "jdbc 3 problem with buttons" Watch "jdbc 3 problem with buttons" New topic
Author

jdbc 3 problem with buttons

Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
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 ...


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
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

Joined: Jan 16, 2001
Posts: 424
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.
 
subject: jdbc 3 problem with buttons