maggiemel
Posts: 75
|
| Posted: 11/01/2006, 10:53 AM |
|
Hello everybody! I create an Editable Grid that allows a user to upload files. I did this by using the FileUpload component within each row of the grid. My problem is that there are now two delete boxes on my form -- one that is built into the FileUpload component and the other which is the Delete checkbox feature of the Ed Grid.
The Ed Grid delete feature works properly (removing both the file and the record), but the delete box that is part of the FileUpload component seems problematic when it is checked and the form is then submitted. It seems like the file is deleted, but the entry in the database is not and the "redirect" action for the form doesn't happen. So, if possible, I'd like to eliminate this checkbox and go with the Ed Grid Delete checkbox. Does anyone know if this can be done?
Thanks in advance for any assistance!
_________________
Melissa Cahill
http://www.hellcatmaggie.net/ |
 |
 |
feha
Posts: 712
|
| Posted: 11/01/2006, 11:14 AM |
|
That is the right way it should work.
The fileupload delete checkbox is supposed to delete onlt the file not the record in DB ...
Incase you want to replace just image or uploaded file but preserve the DB record.
_________________
Regards
feha
www.vision.to
feedpixel.com |
 |
 |
maggiemel
Posts: 75
|
| Posted: 11/01/2006, 12:16 PM |
|
Right, but that's not what I want. I don't want the user to be able to delete the file without deleting the record. When they do that, the grid gets submitted but there is no return page and so things get screwy. Do I need to write a custom function to delete the associated record and reload the page? Where would such a function be called -- After Submit? I was thinking it would just be easier to disable or hide the delete box within the FileUpload component....
_________________
Melissa Cahill
http://www.hellcatmaggie.net/ |
 |
 |
matheus
Posts: 386
|
| Posted: 11/02/2006, 3:32 AM |
|
Try something like this:
<!-- BEGIN FileUpload FileUpload1 --><input type="hidden" value="{State}" name="{ControlName}">
<!-- BEGIN Info --> {FileName} {FileSize} bytes. <!-- END Info -->
<!-- BEGIN Upload --><input type="file" name="{FileControl}"><!-- END Upload -->
<!-- BEGIN DeleteControl -->Delete <input type="checkbox" name="{DeleteControl}" {DeleteChecked}><!-- END DeleteControl -->
<!-- END FileUpload FileUpload1 -->
Try DELETE DeleteControl Block.
<!-- BEGIN FileUpload FileUpload1 --><input type="hidden" value="{State}" name="{ControlName}">
<!-- BEGIN Info --> {FileName} {FileSize} bytes. <!-- END Info -->
<!-- BEGIN Upload --><input type="file" name="{FileControl}"><!-- END Upload -->
<!-- END FileUpload FileUpload1 -->
If gives errors, that put empty space in DeleteControl block.
<!-- BEGIN FileUpload FileUpload1 --><input type="hidden" value="{State}" name="{ControlName}">
<!-- BEGIN Info --> {FileName} {FileSize} bytes. <!-- END Info -->
<!-- BEGIN Upload --><input type="file" name="{FileControl}"><!-- END Upload -->
<!-- BEGIN DeleteControl --><!-- END DeleteControl -->
<!-- END FileUpload FileUpload1 -->
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
maggiemel
Posts: 75
|
| Posted: 11/03/2006, 7:15 AM |
|
Thanks, Matheus. This works (need to leave the DeleteControl block in w/an empty space).
_________________
Melissa Cahill
http://www.hellcatmaggie.net/ |
 |
 |
matheus
Posts: 386
|
| Posted: 11/03/2006, 9:43 AM |
|
Great that this can helped.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |