Page 1 of 1

Move caret position programatically in Oxygen XML Web Author

Posted: Mon Jun 25, 2018 9:35 am
by sriram_l
Hi, How to move the caret position to desired element in Oxygen XML Web Author
scenario - I've a list(ul) and the user is allowed to place the cursor in any of the list items(li) to edit using a form like dialog. I'm able to navigate the DOM till the parent 'ul' and the type of object I got is "sync.api.dom.Element" I want to place the caret position on this parent 'ul'. Please let me know how to move the caret to the parent 'ul'

Re: Move caret position programatically in Oxygen XML Web Author

Posted: Mon Jun 25, 2018 10:24 am
by cristi_talau
Hello,

You can try using something like:

Code: Select all


var selInUl = sync.api.Selection.createEmptySelectionInNode(element, 'before');
editor.getSelectionManager().setSelection(selInUl);
Best,
Cristian

Re: Move caret position programatically in Oxygen XML Web Author

Posted: Mon Jun 25, 2018 11:40 am
by sriram_l
Awesome! that did the trick.