function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
charlie_vcharlie_v 

Insert Image in <apex:inputTextarea> field

Is there a way to insert an image from Documents into an <apex:inputTextarea> field?
Best Answer chosen by Admin (Salesforce Developers) 
AvromAvrom

When you go into your Documents tab, and go to the folder containing the image, there's a link to "view". You can enter this URL when the textArea asks you for the image location. Yes, the URL is dynamic, but that's fine--so long as whoever's viewing the record has permission to view that document (if they don't, they'll get a broken image, I think).

 

You don't want to use the link directly under the image name--that takes you to a summary page for the image's document.

Message Edited by Avrom on 01-07-2010 12:17 PM

All Answers

kshannonkshannon
As to my knowledge, standard input fields do not allow for any images inside of them, do you mean you would like to upload an image? or do you mean that you just want the link for an image that is already uploaded to display? If you want an actual image to be shown inside a textarea, you are going to need to have that be a rich text area.
charlie_vcharlie_v

Yes, I realize that ... I already have the control's property set to "richtext="true".  But even having done so, how, exactly, can you reference an image in Documents, and then use the control with

 

<apex:outputText value="{!richTextFieldwithImage}" escape="false"></apex:outputText>

 

Or can you?  I've tried every way I can think of.

AvromAvrom

When you go into your Documents tab, and go to the folder containing the image, there's a link to "view". You can enter this URL when the textArea asks you for the image location. Yes, the URL is dynamic, but that's fine--so long as whoever's viewing the record has permission to view that document (if they don't, they'll get a broken image, I think).

 

You don't want to use the link directly under the image name--that takes you to a summary page for the image's document.

Message Edited by Avrom on 01-07-2010 12:17 PM
This was selected as the best answer
charlie_vcharlie_v
Brilliant!  That works!  Thank you very much.  :smileyvery-happy: