Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Two editors shown in one page impact each other on validation result.

Hi,

Orion 9.0 bring a new build called 'Code Edit' with basic plugins support. When I follow the wiki to show the editor in html, it works fine on js validation. But when I try to show two editors in one page, there is a problem. The initial contents are always the same although I set different value in contents. And validation result will impact each other.
For example: line 1 in editor A has syntax error. But line 1 in editor B is correct. But both editor A and B show error annotation on line 1.  Every validation result in one editor will be displayed in another editor.


Here is the code I used to show two editor (just copy the create method again from the example)
codeEdit.create({parent: "embeddedEditorA", contentType: "application/_javascript_", contents: contentsA}).then(function(editorViewer) {
       document.getElementById("progressMessageDiv").textContent = "Plugins loaded!";
       //You can call APIs from editorViewer.editor  for further actions.
});

codeEdit.create({parent: "embeddedEditorB", contentType: "application/_javascript_", contents: contentsB}).then(function(editorViewer) {
       document.getElementById("progressMessageDiv").textContent = "Plugins loaded!";
       //You can call APIs from editorViewer.editor  for further actions.
});


I need to show multiple editor in one page or in multiple tab. Does anyone know how to fix this issue?  

Best Regards!



Back to the top