tyoshikawa1106のブログ

- Force.com Developer Blog -

VisualforceとCKEditor①

VFページ上にCKEditorを表示する方法を調べました。
1.<apex:includescript>でckeditor.jsを読み込む
2.<apex:inputtextarea>にstyleClass="ckeditor"を指定
3.<apex:inputtextarea>のrichtext="false"を指定

<apex:page StandardController="Account">
<apex:form >
<apex:pageBlock title="CKEditor">
<apex:includescript value="{!URLFOR($Resource.ckeditor, 'ckeditor/ckeditor.js')}" />
<apex:inputtextarea value="{!Account.Description}" styleClass="ckeditor" richtext="false"/>
</apex:pageBlock>
</apex:form>
</apex:page>

これでテキストエリアをCKEditorに置き換えることができます。

f:id:tyoshikawa1106:20120901113046p:plain