2 Replies Latest reply on Mar 5, 2011 7:17 PM by Rocky S

    Working WYISWYG Editor for RichFaces 4

    Hemant Gupta Newbie

      Hi

       

      Can anyone tell me which WYISWYG editor can be used with RichFaces 4 and JSF 2? I am using TinyMCE but having problem updating text.

       

      <h:inputTextarea id="content" style="width: 100%; height: 400px" value="#{someBean.saveData}" />

       

      I am using this line with TinyMCE. The editor displays the content well, but when I try to edit and save the data, the updated data is not saved. Instead, the old data is saved again and again.

       

      Please anyone help me out.

        • 1. Working WYISWYG Editor for RichFaces 4
          Hemant Gupta Newbie

          Hi

           

          Finally, I was able to find a workaround for the problem. Anyone can use TinyMCE with JSF 2 and RichFaces 4. You just need to add few lines:

           

          save_onsavecallback : "myFunction", [Use this comma properly.]

           

          This line should be added to the init method of TinyMCE. Then, create a function named "myFunction" or any name you want. This function will allow TinyMCE to update the textarea with latest data. Finally, call this function from onClick of the commandButton. <a4j:commandButton onClick="myFunction()" />

          function myFunction()

          {

                tinyMCE.triggerSave();

          }

          • 2. Working WYISWYG Editor for RichFaces 4
            Rocky S Master

            I use the editor the one comes with JBoss providing visual/source/preview.