Reputation: 231
I'm using JSF and Primefaces. I have an h:outputText which holds a lot of text in it. It is mostly just text that the user just views and I do not want to start putting it into a datatable if possible.
But I do need an event when a user double clicks on a word (or any other selection event will do).
Is there any way to get such an event with the selected word or (even better) the location inside the text (e.g. after how many characters the double click was done)?
If I need to change the element - to which one should I change it so that it remains relatively simple?
Upvotes: 0
Views: 1494
Reputation: 1109292
Just use plain HTML.
<span ondblclick="...">#{bean.text}</span>
Abusing a <label>
as generated by <p:outputLabel>
is not the right way.
Upvotes: 1