Create new element when user types where text is not allowed

Oxygen general issues.
tzimnoch
Posts: 6
Joined: Wed Dec 03, 2014 12:48 am

Create new element when user types where text is not allowed

Post by tzimnoch »

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: 1016
Joined: Wed Nov 16, 2005 11:11 am

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

Post by alex_jitianu »

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
Joined: Wed Dec 03, 2014 12:48 am

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

Post by tzimnoch »

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.
Post Reply