close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Delete files with the new dataassist

Thread began 5/21/2012 11:14 pm by Miguel | Last modified 5/24/2012 3:26 pm by Jason Byrnes | 1293 views | 3 replies |

Miguel

Delete files with the new dataassist

How can i use the file manipulation now to delete files that where uploaded for X record, i added the behavior, selected the trigger if button delete is pressed, selected the folder, but how can i tell it the exact file, i try to simulate the javascript that the button has

onclick="document.getElementById('WADADeleteRecordID').value=<?php echo($row_WADAbanco['idBanco']); ?>;document.getElementById('borrarar').value=<?php echo $row_WADAbanco['Logotipo']; ?>;document.getElementById('deleteBox').style.display = 'block';document.getElementById('deleteMessage').style.display = 'table';"



i also created a hidden input field witht he name borrarar and added the value of the recordset now the new thing on the delete icon is:

document.getElementById('borrarar').value=<?php echo($row_WADAbanco['Logotipo']); ?>



but adding that gives me a script error and the delete doesn't work any more.

Please give us advice about how can we delete files that where uploaded and inserted with the new dataassist, i cant image when i will have more than one file field to delete, it was very easy on the version before databridge now it has become a pain to delete files unless we do more work that we are suppose to and create a special delete page without the wizard but then what is the point of having a wizard to save time and spending the money on each upgrade of the super suite?

I see that the new dataassist is really a much more improved version of the version before data bridge but its still missing so much to totally integrate with the rest of the extension, i also have to hand code each form each result page detail page if i work with the Framework Builder (Dynamic Plug-ins), :confused: dataassist should have a way to work with this without so much hand code its a must please add this to the wish list cause right now its not saving much time than before!

PD
Also Reporting a bug since the new databridge uploading png pictures with transparent background is broke again it adds black to the background.

Another bug is when in the dataassist wizard when i click on the search to add it also on the result page the result page comes out with just the search and nothing more.

Sign in to reply to this post

Jason ByrnesWebAssist

since the name of the file is a string, it will need to be enclosed in single quotes in the onclick event:

php:
document.getElementById('borrarar').value='<?php echo($row_WADAbanco['Logotipo']); ?>'




you can use the files created by the wizard in dynamic plugins, there is no need to hand code them.


to build a results page that includes the search form, go to the Data Assist Create pages wizard, and go to the Manage pages tab. Click the Plus button and select Results page to have a results page created, in the results page settings, click the plus button to select the columns to include in the results layout and click ok.

click the plus button again and select Search, in the search page settings, select the option to include the Search form on the results page.


I have logged the issue with png backgrounds. can you provide some more details though:
are you resizing the image? Using Images only? are you converting the Image types? Some additional details on the upload settings you are suing would help us track the issue down.

Sign in to reply to this post

Miguel

As always Jason ftw thanks for your response

Ok sorry i did not explain my self well on the search part, i know how to add the search the thing is that when its created by the wizard the result pages comes out with the search on it but the list of records disappears from the code, i think it might be a bug, and the filex_search.php page ends up with 2 search forms instead of one.

The image upload yes im resizing to fit box.

I will try tonight to work with the delete how does it detect the correct file from the result list?

Sign in to reply to this post

Jason ByrnesWebAssist

The only way I can reproduce the issue you specify is to not go through the steps of setting up the results page in the wizard. you need to click the plus button, select Results page, then in the results page setup, select the database column that should be included in the results listing. If I perform those steps, I get the search and results created correctly, if not, the results page is empty like you say.


php:
I will try tonight to work with the delete how does it detect the correct file from the result list?



well, you say you added a hidden element to the delete form, and added the code to the onclick event of the delete button to pass the file name to the hidden element, so it is the hidden element that should be used in the delate behavior for the file name.

Sign in to reply to this post

Nico

How you do it

Hi. Sorry to ask again but don't understand what you actually do and you delete the file. I am on the details page and adding a new server behavior to delete the image when button delete pressed. I actually use the same trigger databridge uses for deleting the record.

Although the same method works when I am on the results page, it doesn't do anything when on details page.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the details page please

Sign in to reply to this post

Nico

File

Originally Said By: Jason Byrnes
  send a copy of the details page please  



First of all thank you for your reply Sades + Jason.

Sades: Tried what you indicate but not working. Must be missing something.
Jason: I include the php file.

Once again thank you for your time

Attached Files
detailPage.zip
Sign in to reply to this post

Miguel

Hello nico change this to the form

From:

html:
<form class="DetailsPage DetailsPage Compact_Default" id="Details_Compact_Default" name="Details_Compact_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">



To

html:
<form action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>" method="post" enctype="multipart/form-data" name="Details_Compact_Default" class="DetailsPage DetailsPage Compact_Default" id="Details_Compact_Default">



and test it again the form is missing enctype="multipart/form-data"

Sign in to reply to this post

Nico

Still not working

Thank you Sades for your time but, addining enctype didnt make it work

De donde eres?

Sign in to reply to this post

Jason ByrnesWebAssist

you have the record delete and file delete behaviors both set to trigger on the delete button being pressed.


the problem is that code to delete the record happens before the code to delete the file, and the record delete is set to redirect after the delete, the redirect happens before the file delete code has a chance to trigger.

you will need to rearrange the code so that the file is deleted before the record is deleted.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...