Ticket #10735: ckeditor-bug.txt

File ckeditor-bug.txt, 3.7 KB (added by ofss, 6 years ago)

Details the issue with code snippet.

Line 
1
2Scenarios:
3
4First time the page loads, ckeditor loads in readonly mode with content editable as false.
5
6Once the data is fetched from the DB and text area is populated with the data text, the CKEitor button remains disabled as expected, however text data editing area still allows the user to edit the data in chrome even as the component is coded to be readonly & disabled.  This works properly in mozilla and IE.
7
8Code for making readonly in java from ADF screen.
9
10            script.append("if(typeof (CKEDITOR.instances.ckeditor) != 'undefined')" +
11                          "{CKEDITOR.instances.ckeditor.setReadOnly();" +
12                          "CKEDITOR.instances.ckeditor.contentEditable=false;" +
13            "document.getElementsByName(\"ckeditor\")[0].readOnly=true;}");
14
15             script.append( "CKEDITOR.instances.ckeditor.setReadOnly();");
16
17
18--------------
19CKEditor Usage
20--------------
21
22We used the ckeditor in follwoing way.
23
241.              Used ckeditor tag in JSF followed by the javascript as shown.
25
26<af:panelLabelAndMessage label="#{com_ofss_fc_ui_view_messageTemplateUI.LBL_MESSAGE_DATA}"
27                                       binding="#{MessageTemplateUIMaintenance.plam4}"
28                                       id="plam2" showRequired="true">
29                <ckfinder:setupCKEditor basePath="ckfinder/" editor="ckeditor"/>
30                <ckeditor:editor basePath="ckeditor/" editor="ckeditor" value="${bindings.templateBuffer.inputValue}"></ckeditor:editor>
31                <trh:script id="s1" generatesContent="true">
32                    createUpdateEditor('ckeditor', false);
33               </trh:script>
34              </af:panelLabelAndMessage>
35
362.  Method createUpdateEditor as shown below:
37
38function createUpdateEditor(editor, taskflow){
39     try{
40       if (CKEDITOR.instances[editor]) {
41          CKEDITOR.remove(CKEDITOR.instances[editor]);
42       }
43       var ip = window.location.hostname+':'+window.location.port;
44       var basepath = null;
45       if(taskflow == false){
46         basepath = "com.ofss.fc.ui.view";
47       }else{
48         basepath = "/workflow/com.ofss.fc.workflow.ui.common.approval/";
49       }
50       var editorInsatnce = CKEDITOR.replace(editor,
51        {"filebrowserImageBrowseUrl":"http:\/\/"+ip+"\/"+basepath+"\/ckfinder\/ckfinder.html?type=Images",
52        "filebrowserBrowseUrl":"http:\/\/"+ip+"\/"+basepath+"\/ckfinder\/ckfinder.html",
53        "filebrowserFlashBrowseUrl":"http:\/\/"+ip+"\/"+basepath+"\/ckfinder\/ckfinder.html?type=Flash",
54        "filebrowserUploadUrl":"\/"+basepath+"\/ckfinder\/core\/connector\/java\/connector.java?command=QuickUpload&amp;type=Files",
55        "filebrowserImageUploadUrl":"\/"+basepath+"\/ckfinder\/core\/connector\/java\/connector.java?command=QuickUpload&amp;type=Images",
56        "filebrowserFlashUploadUrl":"\/"+basepath+"\/ckfinder\/core\/connector\/java\/connector.java?command=QuickUpload&amp;type=Flash"});
57       CKFinder.setupCKEditor(editorInsatnce, 'ckfinder/');
58     } catch(e){
59       alert("instance is not ready");
60     }
61     
62      CKEDITOR.appendTo(editor,
63     {"filebrowserImageBrowseUrl":"http:\/\/"+ip+"\/"+basepath+"\/ckfinder\/ckfinder.html?type=Images",
64     "filebrowserBrowseUrl":"http:\/\/"+ip+"\/"+basepath+"\/ckfinder\/ckfinder.html",
65     "filebrowserFlashBrowseUrl":"http:\/\/"+ip+"\/"+basepath+"\/ckfinder\/ckfinder.html?type=Flash",
66     "filebrowserUploadUrl":"\/"+basepath+"\/ckfinder\/core\/connector\/java\/connector.java?command=QuickUpload&amp;type=Files",
67     "filebrowserImageUploadUrl":"\/"+basepath+"\/ckfinder\/core\/connector\/java\/connector.java?command=QuickUpload&amp;type=Images",
68     "filebrowserFlashUploadUrl":"\/"+basepath+"\/ckfinder\/core\/connector\/java\/connector.java?command=QuickUpload&amp;type=Flash"}); 
69  }
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy