in Education by
I'm using Grails 1.3.7 and I use tinyMCE via richui. I'm trying to display a modal window which enables users to send a mail. However, if tinyMCE is correctly displayed, I can't use the text editor because of this error : t.win.document is null I finally found the reason here, at the end of the article : http://blog.mirthlab.com/2008/11/13/dynamically-adding-and-removing-tinymce-instances-to-a-page/ It seems that when I call the page with the jquery script building the modal window, DOM isn't refreshed and doesn't create the corresponding textarea. Anyway I don't know how to resolve this, so here is my code : Jquery code : function dialogSendFirstMail(id) { var monurl = "/myApp/emailTemplate/writeFirstMail.gsp?id_for_mail="+id; var titre = "Premier email" //alert(monurl); $("#dialogSendFirstMail").load(monurl, function() { $(this).dialog({ height: 'auto', width:'auto', modal: true, position: 'center', overlay: { backgroundColor: '#000', opacity: 0.5 }, title:titre }); }); } GSP calling the script for the modal window : <!-- ... -->
dialogSendFirstMail(${idProfil}); modal window (only this for the moment) : In summary, if I detect that I have to send a first mail, the page creates a div in which is placed tinyMCE. This is what the user will see. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
As you have mentioned, the reason that you the the error "t.win.document is null" is because the DOM isn't refreshed. So you will have to add the tinyMCE control explicitly when you load the modal dialog. You can use something like this in the gsp which renders the richUI editor (writeFirstMail.gsp in your case) : jQuery(document).ready(function() { //your tinyMCE settings here tinyMCE.settings = { mode : "textareas", theme : "simple", editor_selector : "mcesimple", width: 400 }; tinyMCE.execCommand("mceAddControl", false, "yourTextareaId"); }); Once the dialog is closed, you can remove tinyMCE control from the textarea using this: tinyMCE.execCommand("mceRemoveControl", false, "yourTextareaId");

Related questions

0 votes
    Which of the following plugin in Bootstrap is used to create a modal window? popup alert modal window...
asked Mar 2, 2021 in Technology by JackTerrance
0 votes
    Which of the following plugin in Bootstrap is used to create a modal window? popup alert modal window...
asked Feb 28, 2021 in Technology by JackTerrance
0 votes
    Write code in HTML to divide the browser window into 3 horizontal sections and display college name in the top most frame. Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    When will the window property come into play? (a) Representation convenience (b) Use as an extension of ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    A window into a portion of a database is (a) Schema (b) View (c) Query (d) Data dictionary The ... and Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    I have three components - app, sideNav and wallForm. In the app header, I have a button that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
0 votes
    I have an AbsoluteLayout with a Frame and a Notification. The problem is when I use this.$showModal(.. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I'm trying to get a modal to pop up on cellClick. I'm not getting any errors, but it's not ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I have a Bootstrap modal dialog which contains a form. The modal dialog contains a submit and a cancel ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have some wizard-like pages in my application, its keeping state while navigating between small steps, the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    How to use custom table in Laravel Modal ?...
asked Sep 30, 2021 in Technology by JackTerrance
0 votes
0 votes
    Without using both the record and system utility script, how can you open a notepad window?...
asked Oct 19, 2020 in Technology by JackTerrance
0 votes
    Hello fellow developers I have a little question. I have a problem that's starting to annoy me. I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    Let us say I have a inputStream and I perform some window operation on it. What is the timestamp ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
...