Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I am using <apex:inputField> to display a richtext field on my VF page as I found out that the "Upload Images" functionality only exits when I render those fields not with <apex:inputTextarea richtext="true"... />.

My problem now is that there is no rows attribute on <apex:inputField> to set the height of the textarea. I tried just adding a style="height:xyz px" but this didn't work.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Depending on how fine grain of a control you need on the height you can just set the # Visible Lines property of the actual field on the Custom Field Definition. It must be between 10 and 50 lines, though.

share|improve this answer

Edit: FWIW, in my org the "Upload Images" functionality works alright on Rich Text Area fields - maybe triple check your config? If you can resolve that, @PeterKnolle has the better answer.

Salesforce use CKEditor to decorate the richtext editor on top of a textarea. They leave the editor identifier in the global scope, and you can call resize to tweak as needed.

The nice way to do this would be to use the instanceReady hook:

<script>
  editor.on('instanceReady', function(event) {
    event.editor.resize(0, 400); //leave first parameter as 0 to affect only height.
  });
</script>

The nasty way to do this is to trash the CSS:

<style>
  .cke_contents {
    height: 400px !important;
  }
</style>

upload images

share|improve this answer
    
How did you embedd the textarea into your page? Its working with inputField but not with inputTextarea. –  Robert Sösemann Feb 5 '13 at 19:11
    
On a custom page: <apex:page><apex:form><apex:inputTextarea richText="true" /></apex:form><script>editor.on('instanceReady', function() {editor.resize(0, 400);});</script></apex:page> - note the script is after the form. –  user320 Feb 5 '13 at 20:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.