Skip to main content
Participant
September 2, 2010
Answered

Non-editable text Element

  • September 2, 2010
  • 1 reply
  • 513 views

Hi

I need to create a text that should not be editable. You can insert it, delete it, change styles  but not edit the text in it.

I've tried creating a new CustomElement inspired by the SpanElement.

The inserts gets done OK, but when the I try to insert or modify the InsertTextOperation creates a new SpanElement and not my CustomElement type. That it calls replaceText that of course that  throws an error.

Any Ideeas how I can create My Custom element or prevent the modifcations to happen to that element?

Thank you

This topic has been closed for replies.
Correct answer rdermer

Suggest to set a userStyle to mark read-only elements.  Then listen to FlowOperationBegin events on the TextFlow and cancel or modify operations that modify the read-only text.

Richard

1 reply

rdermerCorrect answer
Adobe Employee
September 2, 2010

Suggest to set a userStyle to mark read-only elements.  Then listen to FlowOperationBegin events on the TextFlow and cancel or modify operations that modify the read-only text.

Richard

Participant
September 2, 2010

Yes, That works Thanks.