Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6946615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:35:16+00:00 2026-05-27T13:35:16+00:00

I have a CKEditor in my page. Like this <h:head> <title>Facelet Title</title> <script type=text/javascript

  • 0

I have a CKEditor in my page. Like this

<h:head>
    <title>Facelet Title</title>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>

    <script language="JavaScript">

        function comeBack(){
            document.getElementById(editorValue).value = this.value;
        }

    </script>

</h:head>

<h:body >

    <h:form id="ckEditorForm" prependId="false" >

        <textarea id="editor1"
                  name="editor1"
                  onblur="alert(document.getElementById(editorValue).value = this.value);">

        </textarea>

        <script type="text/javascript">
            CKEDITOR.replace( 'editor1' );
        </script>

        <h:inputHidden value="#{editorBean.value}" id="editorValue" />

        <h:commandButton id="submit"
                         value="Submit"
                         action="welcome.xhtml" />


    </h:form>

</h:body>

@ManagedBean
@ViewScoped
public class EditorBean {

    private String value;

    /** Creates a new instance of EditorBean */
    public EditorBean() {

    } //end of constructor

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
        System.out.println("Content: "+value);
        System.out.println();

    }

} //end of class EditorBean

Now i want that user press the submit button then the editor value is save into my bean. I found this hiddenfield technique suggested by some one on this forum , but it is not working. Am i doing something wrong? How can i achieve what i want?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:35:16+00:00Added an answer on May 27, 2026 at 1:35 pm

    You need to understand that JSF is a HTML code generator and that JavaScript has basically only access to the HTML DOM tree, not the JSF source code.

    Open the page in browser, rightclick and choose View Source. Locate the generated HTML of the <h:inputHidden> component. It’ll look something like this:

    <input type="hidden" id="ckEditorForm:editorValue" name="ckEditorForm:editorValue" value="" />
    

    Please note the id attribute value. You have to use exactly this value in your JavaScript document.getElementById():

    document.getElementById("ckEditorForm:editorValue");
    

    By the way, much easier is to just use <h:inputTextarea> instead:

    <h:inputTextarea id="editor1" value="#{editorBean.value}" />
    <script>CKEDITOR.replace("ckEditorForm:editor1");</script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have an image like this (created by CKEditor): <img src=foo.jpg style=float: left;
i have this: <%@ Control Language=C# Inherits=System.Web.Mvc.ViewUserControl<string> %> <script src=<%=Url.Content(~/Scripts/ckeditor/ckeditor.js)%> type=text/javascript></script> <script type=text/javascript> $(document).ready(function()
I have a node with a text area editable with CKEditor. THis means my
I have the following: POST page that allows users to write text in CKEditor
I have the following code that correctly generates the CKEditor: <script> $(function(){ $(#newWrite_body).ckeditor({ extraPlugins
I have something like this <h1> I am Text </h1> in asp.net MVC If
I have a CKEditor used to edit a text in a web-page. In the
I have integrated CKeditor with my admin panel (php) I have writtien a function
I have an instance of CKEditor on a page. I am trying to give
I have a form that uses CKEditor and all works. I save the text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.