CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 File Upload in Editable Grid -- how to eliminate double delete fields?

Print topic Send  topic

Author Message
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/
View profile  Send private message
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
View profile  Send private message
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/
View profile  Send private message
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
View profile  Send private message
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/
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.