Webauthor - get selected text via JS api

Post here questions and problems related to oXygen frameworks/document types.
mwiechec
Posts: 3
Joined: Mon Nov 19, 2018 10:49 pm

Webauthor - get selected text via JS api

Post by mwiechec » Thu Apr 25, 2019 8:53 pm

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

mihaela
Posts: 211
Joined: Wed May 20, 2009 2:40 pm

Re: Webauthor - get selected text via JS api

Post by mihaela » Fri Apr 26, 2019 12:00 pm

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
Mihaela Calotescu
http://www.oxygenxml.com

Post Reply