Move caret position programatically in Oxygen XML Web Author

Oxygen general issues.
sriram_l
Posts: 10
Joined: Wed Jun 06, 2018 4:59 pm

Move caret position programatically in Oxygen XML Web Author

Post 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'
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: Move caret position programatically in Oxygen XML Web Author

Post 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
sriram_l
Posts: 10
Joined: Wed Jun 06, 2018 4:59 pm

Re: Move caret position programatically in Oxygen XML Web Author

Post by sriram_l »

Awesome! that did the trick.
Post Reply