I have a Tridion GUI extension (Tridion 2013 SP1 - but I don't think this matters much) that inserts a piece of text in a rich text field.

The text is inserted correctly, using the applyHTML("text") method, but after inserting, the inserted text is selected in the RTF field.

Is there a way to unselect this element, and move the cursor to the end of the inserted text ?

I see for example that inserting a hyperlink (via the standard tridion GUI) has this behaviour. Can I achieve something similar ?

  • Hi Harald - did you resolve this issue? Aug 17, 2014 at 18:33
  • no, we haven't found a solution to this. The requirement slightly changed, so we don't need this behaviour any more, but it would be useful still to know how to get this done (if it's possible at all). Aug 18, 2014 at 7:12

1 Answer 1


Is it possible to use the start and length of the selection object to then 'setSelection' to (start+length, 0)?

The comment

...inserting a hyperlink (via the standard tridion GUI) has this behaviour

is slightly misleading

  • when you select an existing text and add a hyperlink - the text will remain select
  • when you enter a new link with nothing selected then this text/link is 'added' into the RTF field and thus nothing is selected

This leads to the thought that perhaps another approach is using target.editor.copy() and target.editor.paste() as this (out of the box) format application results in nothing being selected after application - of course, this assumes paste is going to work (possible permissions?) and would replace anything the user may have had in the clipboard.

Also, you can see that there is a _removeSelection() on the listViews so it's possible you could write/extend something similar?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.