NetTalk Central

Author Topic: Display image on a form  (Read 3143 times)

jhalpin

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Display image on a form
« on: August 17, 2010, 12:00:32 PM »
Hi. C7.2, Nettalk 5...

I'm very new to this stuff, and I'm trying to display an image on a form. I have the image file name in  a field in a related table. I get the data from the table and place it in the session queue. It correctly displays the file name on the form, but no image. I set up a display field on the form, and I put this on the Image tab for the display field for the name of the image file:

p_web.CreateImage(OIM:ImageFileName)

When I look at the transmission, I see that instead of sending the file name for the src, it sends this:

/%3Cimg%20src%3D%22images/please.jpg%22%20width%3D%22%22%20height%3D%22%22%20alt%3D%22%22%20border%3D%220%22%20align%3D%22absmiddle%22%20%20%20%20/%3E

The file name is in there, but the html source can't use this. I'm clueless. Thanks,
Jim


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Display image on a form
« Reply #1 on: August 17, 2010, 10:38:15 PM »
should be

p_web.GetSessionValue('OIM:ImageFileName')

not
p_web.CreateImage(OIM:ImageFileName)

jhalpin

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Display image on a form
« Reply #2 on: August 18, 2010, 08:56:42 AM »
Thanks, Bruce. That did it.

What is CreateImage used for? Does the Display choice for a field do the same thing with explicitly using CreateImage?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Display image on a form
« Reply #3 on: August 22, 2010, 11:33:57 PM »
>> What is CreateImage used for?

it takes a bunch of parameters and creates the html <img> tag.

>> Does the Display choice for a field do the same thing with explicitly using CreateImage?

not 100% sure what you're asking, but yes, the templates use CreateImage.

cheers
Bruce