Hi.
I want ot use the TinyMCE editor in my jsf code, but unfortunately there is error in using the init function, and also in eclipse when I copy the folder of the tinyMCE, there is warning sign on the folder.

can any one help me through this issue ???

NOTE:
I downloaded the "Main package" and then I copy the folder of the "tinyMCE" into my project directory and then I used the following code:

<!-- TinyMCE -->
<script src="tiny_mce/tiny_mce.js" type="text/javascript"></script>
   <script type="text/javascript">
        tinyMCE.init({
        mode : "textareas",
        theme : "simple",
        width : "800",
        height : "480"
 });
</script>

<!-- /TinyMCE -->

nothing happen to my text area ? and also I get the warning error in the problems tab of the eclipse editor: (attached)

Thanks

Dani AI

Generated

Short summary: the Eclipse warning seen by is a validator message (common with libraries that use camelCase event attributes), while TinyMCE not showing is almost always a resource/timing issue in the page rather than a JSF-specific bug. was right to suggest checking the browser error console — that typically points directly to the problem (missing file, load order, or a runtime JS error).

Key troubleshooting checklist (most likely fixes)

  • Verify the TinyMCE script actually loads in the browser (view source or open the script URL from the page). A 404 or network error will produce “tinyMCE is not defined” or similar in the console.
  • Make sure the editor init runs after the textarea is present in the DOM (JSF can change rendering order). Initializing too early is a common cause.
  • When using JSF input components, avoid relying on predictable client ids. Add a CSS class to the JSF textarea and target that class from TinyMCE instead of trying to guess the generated id. Example pattern (run init on DOM ready):
<script>
window.onload = function() {
  tinyMCE.init({
    mode: "specific_textareas",
    editor_selector: "mceEditor",
    theme: "simple"
  });
};
</script>

Then give the JSF textarea the matching class (for example via styleClass="mceEditor").

Dealing with the Eclipse warning

  • The warning is from the HTML/JS validator treating attributes like onChange as nonstandard; it does not break runtime. Two safe ways to silence it: mark the tiny_mce folder as Derived (Right‑click folder → Properties → Resource → check “Derived”), or exclude that folder from the project validators (Project → Properties → Validation → add an exclude for the folder). Either keeps the library intact while removing validator noise.

Useful artifacts for deeper debugging: the browser console log and the rendered HTML for the textarea (showing the final id/class). Those reveal whether the script was loaded and whether the init ran after the element appeared.

Recommended Answers

All 2 Replies

any idea please ???

The warnings are because the specification uses all lowercase convention when specifying intrinsic event handlers; i.e. onchange in favor of onChange.

Since this is some library specific issue, your best bet is to run this application in Firefox and use the Firefox Error console or the addon Firebug to trace Javascript errors.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.