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
Sandra WicketSandra Wicket 

Visualforce: Textarea remove Hyperlink

Hi there,

the apex:column component is calling a text area field. Is there a way to remove the hyperlinks or at least change the color of the links ? 
Thanks for your help guys. 

Greetings Sandra
Best Answer chosen by Sandra Wicket
KapilCKapilC
Hi Sandra,

You can achive this by  escape="false" attribute. Please find the code below. There is a field "textArea__c"on contact object which had some url and when you run this page you'll see the result.
 
<!-- For this example to render properly, you must associate the Visualforce page
with a valid account record in the URL.
For example, if 001D000000IRt53 is the account ID, the resulting URL should be:
https://Salesforce_instance/apex/myPage?id=001D000000IRt53
See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->

<apex:page standardController="Account">
    <apex:pageBlock title="My Content">
        <apex:pageBlockTable value="{!account.Contacts}" var="item">
            <apex:column value="{!item.name}"/>
            <apex:column value="{!item.phone}"/>
            <apex:column />
            <apex:column >
               <apex:facet name="header">URL</apex:facet>
                       <apex:outputText value="{!item.textArea__c}" escape="false"/>
             </apex:column>

        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Regards,
Kapil
(forcecube@gmail.com)

All Answers

KapilCKapilC
Hi Sandra,

You can achive this by  escape="false" attribute. Please find the code below. There is a field "textArea__c"on contact object which had some url and when you run this page you'll see the result.
 
<!-- For this example to render properly, you must associate the Visualforce page
with a valid account record in the URL.
For example, if 001D000000IRt53 is the account ID, the resulting URL should be:
https://Salesforce_instance/apex/myPage?id=001D000000IRt53
See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->

<apex:page standardController="Account">
    <apex:pageBlock title="My Content">
        <apex:pageBlockTable value="{!account.Contacts}" var="item">
            <apex:column value="{!item.name}"/>
            <apex:column value="{!item.phone}"/>
            <apex:column />
            <apex:column >
               <apex:facet name="header">URL</apex:facet>
                       <apex:outputText value="{!item.textArea__c}" escape="false"/>
             </apex:column>

        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Regards,
Kapil
(forcecube@gmail.com)
This was selected as the best answer
Sandra WicketSandra Wicket
Thanks, it works perfectly !