Groups | Blog | Home
all groups > coldfusion flash integration > april 2006 >

coldfusion flash integration : Popups from a Flash Form


The ScareCrow
4/18/2006 12:00:00 AM
you need to use geturl

Lets assume you get the image path from the db, then use the record id and
pass this to the cf page to display the big image.

<cfinput type="Image" name="myImage" src="scr"
onclick="getURL(bigPicture.cfm?image=#RecordID#);">

Then in the bigPicture.cfm page, just run a query to return the big image path
using the record id.
Now the problem is that you may have more than one image. So this will depend
upon how you have these in the db and how you can distinguish between them.
It my be just easier to pass the path of the big image in the geturl call

Ken

seona
4/18/2006 3:38:17 AM
Hi guys,

I've been wrangling with this one for a bit now. I have a Flash Form which
allows users to see the details of a number of houses. The houses are presented
in a cfgrid, and the detail panel is bound to this grid to display the full
information on the house. This includes between 1 and 4 images. The images are,
by necessity, displayed rather small. What I need to do is to find a way to
make them clickable and open up the full image.

I don't actually care whether this is by opening up a new window with the
image or sitting an element over the existing form with the image, or whatever
(although I'm guessing that opening a new window is probably going to be
simplest). All I want is to be able to get it to work.

My knowledge of ActionScript is practically non-existant. My knowledge of
JavaScript isn't all that fantastic either. As a result, I'm really hoping that
someone can help me out with a snippet of code or something that can get me
moving on this.

Cheers,

Seona.
seona
4/18/2006 10:01:13 PM
Thanks for your reply. I tried it, but all I got was a blank button. Reason
being, I need to have it bound to a cfgrid. It might be easier all around if I
post the page in question:
http://www.renovate.com.au/realestate/index.cfm

You'll see here that you get presented with a grid listing available
properties, and then when you click on one it populates the details panel below
- including pictures. What I was originally trying was the following:

<cfformitem type="html" width="100" height="100" bind="<p><a
href='javascript:;'
onclick='getURL(images/{propGrid.selectedItem.Image1},""_blank"")'><img
src='images/{propGrid.selectedItem.Image1}' width='100' height='100' hspace='2'
/></a></p>"></cfformitem>

The picture displays just fine, and it comes up as a clickable hotspot, but
when you click it nothing happens. Most annoying.

I tried modifying the code you gave me, and came up with:

<cfinput type="Image" name="Image1"
bind="images/{propGrid.selectedItem.Image1}"
onclick="getURL(bigPicture.cfm?image=1);">

This is what gave me the blank button. So did changing "bind" back to "src".
Bummer. :(

Any suggestions about what I'm doing wrong?
The ScareCrow
4/18/2006 11:08:17 PM
I have also not been able to get any html working as you have it.

I missed the quotes, there needs to be quotes around the url path !
Note: You also need "_blank" in the geturl so that it loads a new window

<cfinput type="Image" name="Image1"
bind="images/{propGrid.selectedItem.Image1}"
onclick="getURL('bigPicture.cfm?image=1', '_blank');">

Ken

seona
4/18/2006 11:44:31 PM
Okay, tried that, but still no joy. It just shows a blank button, and when the
button is clicked it gives me the validation errors as it tries to submit the
contact form. I've tried adding a "return false;" to the onclick event, but it
still doesn't work.

I've left it as is on the page so you can see what I mean:
http://www.renovate.com.au/realestate/index.cfm

So what I have is:
<cfinput type="Image" name="Image1"
bind="images/{propGrid.selectedItem.Image1}"
onclickcleaned="getURL('bigPicture.cfm?image=1', '_blank');return false;">

Interestingly, you will note that the email notification I get changes the
event to "onclickcleaned". If I remove the "cleaned" bit to make it like the
code you've actually posted, the entire form fails to come up!

Oh, and I'm in Sydney too. :) Howdy, neighbour!
The ScareCrow
4/19/2006 12:34:36 AM
Not sure what is happening on your end.

I did a quick test with the following code and it worked as I expected

<cfform action="" method="POST" name="myform" format="Flash" id="myform">
<cfinput type="Image" name="myimage" src="Image1.jpg"
onclick="getURL('displayimage.cfm', '_blank');">
</cfform>

The displayimage.cfm page is just
<img src="Image2.jpg" alt="" width="642" height="617" border="0">

Ken


AddThis Social Bookmark Button