You need to sign in to do that
Don't have an account?
pooja Agicha
Decoding the encoded HTML and dispay in Visualforce page
Hi,
I have the Encoded HTML in my visual force page (eg: < "e;) but how to convert it back into HTML and render the page in Visualforce?
Thanks,
Regards ,
Pooja
I believe you are putting mark up in a variable and trying to show that in a VF Page:
In your controller:
String myMarkup = '<strong>This is bold</strong>';
In your VF Page:
<apex:outputText escape="false" value="{!MyMarkup}"/>
escape="false" will display your markup with out escaping it. Use caution though. Please read docs regarding the warnings.
Hi,
Thanks for the reply.I used escape=false in outputtext tag,But it is rendering html text (eg: <p>text</p>).
I actually want to display the result of the HTML.
Thanks,
Regards,
Pooja
<apex:page sidebar="false" showheader="false" standardcontroller="opportunity" extensions="hotdocTemplateController" tabstyle="Task" renderas="html" contenttype="text/html" >
<apex:pageBlock id="pbtaskdesc">
<apex:form id="hdformEntry" >
<apex:pageBlockSection title="Hot Docs" columns="1">
<apex:pageBlockSectionItem >
<apex:inputHidden id="disValue" value="{!HotdocDisplay}" rendered="true"/>
<apex:Outputtext id="txtnotes" value="{!HotdocDisplay}" StyleClass="labelCol"></apex:Outputtext>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<input class="btn" type="button" id="btnclose" value="Test" onclick="display();"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>
Controller class(I am Passing parameters from Visual force page1 to visualforce page 2.This is my 2nd VF page and controler)
{
public String HotdocDisplay{get;set;} public hotdocTemplateController(ApexPages.Standardcontroller stdcontroller){
HotdocDisplay= ApexPages.currentPage().getParameters().get('HDdisplay');Blob b = Blob.valueOf(HotdocDisplay);
String b64 = EncodingUtil.base64Encode(b);
HotdocDisplay = EncodingUtil.urlDecode(b64, 'UTF-8');
b = EncodingUtil.base64Decode(HotdocDisplay);
HotdocDisplay = b.toString();
}
}
Sorry earlier pasted the wrong Outputtext tag.controller is correct.
<apex:pageBlock id="pbtaskdesc">
<apex:form id="hdformEntry" >
<apex:pageBlockSection title="Hot Docs" columns="1">
<apex:pageBlockSectionItem >
<apex:inputHidden id="disValue" value="{!HotdocDisplay}" rendered="true"/><apex:Outputtext id="txtnotes" value="{!HotdocDisplay}" StyleClass="labelCol" escape="False"></apex:Outputtext>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ><input class="btn" type="button" id="btnclose" value="Test" onclick="display();"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>