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
danlatdanlat 

Best Way to do this ....

Hi All,

 

I need to generate a PDF which dynamically includes long paragraphs of text (the longest contains 719 words).

I am new to SF and this is how I propose to do it - but I dont like it:

 

 

The paragraphs included in the PDF will be determined by the user filling out a form.

 

Once the user clicks "submit", the controller class determines which paragraphs to be included and populates a Map containing the paragraphs.

 

The Map is then used in a VisualForce page, within a datalist tag.

 

Now, this works fine but I dont lke the fact that I have EXTEMELY long Strings as values in my map, and because apex doesnt allow line breaks I am envisioning it will be hard to maintain.

 

I would be very grateful to hear from any SF experts to propose a better way of doing this, I am keen to learn so any pointers will be just as good.

 

Thanks a bunch.

Best Answer chosen by Admin (Salesforce Developers) 
TomSnyderTomSnyder

put all your text in a visualforce outputPanel and use the rendered attribute to determine if visible:

 

 

<apex:outputpanel rendered="{!boolShowText1}">

long text 1 

</apex:outputpanel>

 

<apex:outputpanel rendered="{!boolShowText2}">

long text2 

</apex:outputpanel> 

All Answers

TomSnyderTomSnyder

put all your text in a visualforce outputPanel and use the rendered attribute to determine if visible:

 

 

<apex:outputpanel rendered="{!boolShowText1}">

long text 1 

</apex:outputpanel>

 

<apex:outputpanel rendered="{!boolShowText2}">

long text2 

</apex:outputpanel> 

This was selected as the best answer
danlatdanlat

Wonderful, Thanks a lot.

 

I can also apply styles easily this way.

 

Thanks Again.