jsuissa
jsuissa

Reputation: 1762

Saving textarea while using Edit Area javascript plugin

Using the Edit Area Javascript plugin as an HTML editor and having issues saving textarea content. The plugin is working fine until I submit the form and the information is no longer saved as it was prior to including the plugin.

Wondering if anyone has had experience with this plugin and can point me in the right direction.

Code:

    editAreaLoader.init({
        id: "inputLayout"   // id of the textarea to transform      
        ,start_highlight: true  // if start with highlight
        ,allow_resize: "both"
        ,allow_toggle: true
        ,word_wrap: true
        ,language: "en"
        ,syntax: "html"
        ,EA_load_callback: "editAreaLoaded" 
    });

Upvotes: 0

Views: 490

Answers (1)

Do you use beans with jsf? I had the same problem and I solved it taking the value of the text of the request object:

Map<String, String> requestMap =FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String text= requestMap.get("inputLayout");

In this way I have the value in the action method.

Be sure that the button makes a submit. I had a problem with commandlink. I changed that to commandButton with type submit and now it works perfectly.

Upvotes: 3

Related Questions