Cfwindow close and send information to the main page

I would like to use Cfwindow to pop up a cffileupload script, but when the loader is finish uploading the files, I would like it to close and display the loaded content on the main page. I got the cfwindow and cffileuploader part done. Is there a way to do the rest?
overcolorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
Try using the onUploadComplete function to hide/close the window with ColdFusion.Window.xxxx.  The onUploadComplete function fires when all of the files have finished uploading.
0
overcolorAuthor Commented:
Ok I tried that and I think I did it wrong, where do I put that and can I put a url in the script?

onUploadComplete="page.cfm?id=5"

?
0
_agx_Commented:
No it needs to be a javascript function.

<a href="javascript:ColdFusion.Window.show('yourWindow')">Show Window</a>

<script type="text/javascript">
      function closeCFWindow() {
            ColdFusion.Window.hide('yourWindow');
      }
</script>
<cfwindow width="500" height="250"  name="yourWindow">
      <cffileupload  
          url="uploadTarget.cfm"
          onUploadComplete="closeCFWindow"
          progressbar="true"
          name="yourUpload"
          width="450"
          height="200"
            />
</cfwindow>
0
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

overcolorAuthor Commented:
I'm sorry I forgot to tell you something, I have a Cfwindow that allows the user to create the album name, it runs a Cfabort, if everything is pass ok, creates the gallery and displays the CFfileuploader. Once they upload the image I would like the loader to close and go to the main page?? So is there a way to tell the Cffileuploaer to close the current window it is in once done?
0
_agx_Commented:
> So is there a way to tell the Cffileuploaer to close the current window it is in once done?

That's what the code above does.  If you want to redirect the page as well, do a regular javascript redirect right after ColdFusion.Window.hide('yourWindow'); closes the cfwindow.

ie
 function closeCFWindow() {
            ColdFusion.Window.hide('yourWindow');
            // ... <=== put the redirect here
 }
0
overcolorAuthor Commented:
ok let me try
0
overcolorAuthor Commented:
Im getting the link, but it does not work when I click it, I already have the CFfileuploader in a CFwindow because it is being called on from the CFabort in the Album creation script..Does that matter?

I think I'm explain it wrong. I don't need a new CFwindow, I just need the current on to close after the image uploads

(1) show the album creation window, once passed then displays the (2) cffileuploader in the same window

(3) is what i get with the new script (link does not work)?


1.png
2.png
3.png
0
_agx_Commented:
It's late and I'll be heading to sleep soon, but I think you may be misunderstanding the example.  

Since you didn't post any code - I created a full example from scratch. So you could have a working example that shows how to create AND close a cfwindow.  In your actual code, all you need to do is add the function that closes the window to your main page:

<script type="text/javascript">
     function closeCFWindow() {
            ColdFusion.Window.hide('yourWindow');
      }
</script>

... then call that function from your cffileupload tag. Make sense?

 <cffileupload  
          onUploadComplete="closeCFWindow"
          ... other attributes ....>

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
overcolorAuthor Commented:
Perfect, the problem was I called the cfwindow a different name on the first page that created the album in the beginning and I was trying to use another name on the up loader. I didn't know the cfwindow name passes over...Sorry and Thank you..
0
_agx_Commented:
No problem. Glad you got it sorted out.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.