2 Replies Latest reply on Jul 13, 2007 7:16 PM by peterent

    Removing image component when image doesn't load

      I have a real estate application that needs to show all of the photos for a particular property when it is clicked on. I am currently using a horizontallist component with an itemrender that contains an image component to show the image. This part is working correctly.

      Here's where the problem starts........each of the image names is based on the property's listing number, so property number 12345 has images 12345_1.jpg, 12345_2.jpg, etc.. There is no image count in the database to tell how many images a property has so the only way for me to do it is to take the ID number from the selected listing and look for files in the images folder that share that ID using cfdirectory with filter="12345*" . There are 480,000 property photos in that directory though, so cfdirectory just gets hung up and never finishes.

      I finally had to resort to creating an array with values from 1-15 so that the horizontallist would always have 15 image boxes created with the current array value passed in. This took the strain off the server and it is working fine. The only thing remaining to do is to remove the broken image boxes that were created for properties with less than 15 photos.

      Can anyone tell me how to accomplish this?