3
votes

I have a primefaces p:treeTable, inside that I define a column includes 2 components: span tag and h:outputText tag. Currently, if I click on one of these elements, select event of table is triggered. But my purpose is that the select event will be fired only if I click of the text (and not for the span element). How can I do that?

1

1 Answers

1
votes

You can prevent the event from bubbling up the DOM, by using JQuery's event.stopPropagation() function.

<span id="someId" onclick="if(event.stopPropagation) event.stopPropagation();">...</span>

JQuery API - event.stopPropagation