Create new element when user types where text is not allowed

<oXygen/> general issues.
tzimnoch
Posts: 6

Create new element when user types where text is not allowed

Wed Apr 27, 2016 12:35 am

The default behavior of AuthorComponentSampleApplet when the user tries to enter text where text is not allowed is a warning message saying "Text is not allowed in element 'elementName' (element only or empty or fixed content)".

I'd like to customize the behavior in some elements so that a specific child element is automatically created for the user and text is entered in the child element. I would still like the warning message to appear for elements other than the one being customized.

How do I go about doing this if this is possible?
alex_jitianu
Posts: 624

Re: Create new element when user types where text is not allowed

Wed Apr 27, 2016 11:41 am

Hello,

We have a Java based extension point that you can use to handle this situation. You have to implement an Author Mode Schema Aware Editing Handler. This handler has a handleTyping() callback in which you can identify this case and take the approach you've described.

[/url]Best regards,
Alex
tzimnoch
Posts: 6

Re: Create new element when user types where text is not allowed

Wed Apr 27, 2016 10:40 pm

Thank you. I have a working implementation of the functionality I wanted.

I really must say that oXygen has been impressively easy to work with given the size of the application. I never know where to start, but once pointed at the right page of documentation it's been easy to see a task to completion.

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 2 guests