Page 1 of 1

Webauthor - get selected text via JS api

Posted: Thu Apr 25, 2019 8:53 pm
by mwiechec
I am trying to get the text from a user selection such as "The quick brown <i>fox</i> jumps over". The user in this case selected the text "brown <i>fox</i> jumps" but when i try to get the text via the getSelection js api all I see is brown and jumps. What I want is just the text "brown fox jumps".

Thank you

Re: Webauthor - get selected text via JS api

Posted: Fri Apr 26, 2019 12:00 pm
by mihaela
Hi,

If you want to make some processing on that selection or make further actions it is better to invoke a custom action [1] in which to obtain the selected text by using the JAVA API [2]. Please let us know if you need more information on this.

[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
[2] https://www.oxygenxml.com/InstData/Edit ... ctedText--

Best regards,
Mihaela