Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RichTextEditor cannot be set to readonly mode (in an easy way) #607

Open
MaRoe opened this issue Aug 21, 2024 · 3 comments
Open

RichTextEditor cannot be set to readonly mode (in an easy way) #607

MaRoe opened this issue Aug 21, 2024 · 3 comments

Comments

@MaRoe
Copy link

MaRoe commented Aug 21, 2024

I am trying to disable the RichTextEditor in some cases. When doing so after initializing the Editor I get an exception (roughly translated).
org.eclipse.swt.SWTException: Property "setReadOnly" of undefined or null cannot be called (org.eclipse.swt.SWTException: Die Eigenschaft "setReadOnly" eines undefinierten oder Nullverweises kann nicht abgerufen werden.)
The UI isn't rendered at the time of the exception.

Nebula opens but is writeable.
If I call the function via a button (UI is already rendered) there is no error.

So how to handle a readonly editor properly?

Thanks in advance :)

@fipro78
Copy link
Contributor

fipro78 commented Aug 21, 2024

The question is at what time you are trying to set the editor readonly. It only works after the initialization is done. IIRC you need to use a ProgressListener and call setReadOnly() on completed.

@MaRoe
Copy link
Author

MaRoe commented Aug 21, 2024

I already tried it that way - no success unfortunately. the ProgressListener is „ready“ but the UI isn‘t drawn yet.
I also tried it with a workaround directly from the ckeditor community with a check for CKEDITOR.status - it’s loaded but the error from above is the same.

@fipro78
Copy link
Contributor

fipro78 commented Aug 21, 2024

Maybe then the readonly function needs to be implemented similar to the focus and initial value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants