Action that inserts a tag and moves the cursor to after that
Oxygen general issues.
-
- Posts: 22
- Joined: Fri Aug 09, 2013 11:03 am
Action that inserts a tag and moves the cursor to after that
Hi guys,
I want to write an InsertFragmentOperation action that inserts "<br/>" and moves the cursor to after that new "<br/>" tag; the tag in the schema is declared so that it doesn't allow any text inside.
In my Author / Action tab, I do have goToNextEditablePosition to true for my action, but the editor still positions the cursor inside the <br/> tag, which forces me to click "right-arrow" to continue typing after inserting a line break.
I saw a very old message saying one has to write a custom action for something like that, is it still true?
Thanks
Yann
I want to write an InsertFragmentOperation action that inserts "<br/>" and moves the cursor to after that new "<br/>" tag; the tag in the schema is declared so that it doesn't allow any text inside.
In my Author / Action tab, I do have goToNextEditablePosition to true for my action, but the editor still positions the cursor inside the <br/> tag, which forces me to click "right-arrow" to continue typing after inserting a line break.
I saw a very old message saying one has to write a custom action for something like that, is it still true?
Thanks
Yann
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Action that inserts a tag and moves the cursor to after
Hi Yan,
When you set the XML fragment to be inserted in the action, you can also use different code templates for it (there is a small drop-down button to the right of the edit area).
So you can set an XML fragment like:
which will force the caret to be after the element.
Indeed empty elements do not have text content but they still have attributes which can be set on them. So maybe the user wants to insert the empty element and then use the Attributes view to edit some attributes on it, that's why the caret is placed inside it by default.
Regards,
Radu
When you set the XML fragment to be inserted in the action, you can also use different code templates for it (there is a small drop-down button to the right of the edit area).
So you can set an XML fragment like:
Code: Select all
<br/>${caret}
Indeed empty elements do not have text content but they still have attributes which can be set on them. So maybe the user wants to insert the empty element and then use the Attributes view to edit some attributes on it, that's why the caret is placed inside it by default.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service