• Krishnan
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,

I'm trying to incorporate a rich text textarea into a Visualforce page. I tried using the richtext="true" attribute,  but it seems like I don't have
very little control over the size and location of the textarea once it's rendered. This creates the rich text editor fine:

Code:
            <apex:pageBlockSection collapsible="true" title="My Form">        
                <apex:inputField value="{!event.Field1__c}"/>
                <apex:inputTextarea value="{!event.Field3__c}" id="specialTextArea" richtext="true"/>
                <apex:inputField value="{!event.Field2__c}"/>
            </apex:pageBlockSection>

 
but adding rows & cols attributes doesn't work, nor does adding css to the element (e.g. style="width:150px; height: 100px"). It just 
displays as wide as it can fit. I'm getting input for a SObject, so I'm using inputField elsewhere, but this seems to work as far as 
getting input in and out goes -- it gets and saves the field data with no problem.

Unlike inputField though, this won't automatically generate a label, so I also tried something like this:
Label <apex:inputTextarea value="{!event.Field3__c}" id="specialTextArea" richtext="true"/>

But that doesn't work either -- it just pushes the rich textarea over to the right.

Has anyone had any luck using this inside a PageBlockSection amongst other inputFields?

I also tried a few other WYSIWYG packages that I used in other work -- TinyMCE and the WYMeditor plugin for jquery. However,
I was not able to get either to work in the visualforce page. Both require a class or id attribute to identify the textArea to make
rich text. Identifying class doesn't seem to work. I also tried using the id, but the id seems to get transformed in the output.
Looking at the source of the html frame, I see something like
id="j_id0:j_id3:j_id4:j_id32:specialTextArea".
I also tried that id, but it didn't work either. If anyone has gotten another
WYSIWYG editor working with visualforce, I'd be interested
in hearing about that also.

thanks,
-paul


Message Edited by ptepper on 07-09-2008 01:21 PM