Hello everyone. I have another question on rich:editor. I am implementing a feature that allows a user to drag a tag, which serves as a placeholder (kinda like a template) into Richfaces component rich:editor at the cursor. I was able to get it to work, but only partially: I can drag and drop the text value of the span into rich:faces, but not the actual tag. Here is what I have:
I know I'm missing something fairly simple, but, unfortunately, I'm rather new to jquery. The method insertAtCaret I've found somewhere on http://stackoverflow.com website and I was able to make it work with the text inside rich:editor, but as placing the actual span there and make sure that rich:editor displays it properly - I'm a bit lost here.
Another thing I've noticed is that you can actually drag and drop the span into rich:editor, at the right place in the text without using jquery, but for that you have to select a span first, which with jquery you can drag the whole thing. It would be great if someone here could help me or point me to the right direction.
I figured it out. However, I have another problem. How would you call "onkeyup" event from rich:editor? I want to be able to check if the user tries to delete a certain object, because some of them are not meant to be deleted, and I need to prevent the user from deleting it. I thought I can use onkeyup event to achieve that, but I don't know how to run it from rich:editor and doesn't do anything. Any suggestions? Thanks