I want to override onclickActiveItem
function and need to retrieve current active item index or call something with onMakeActive
in Primefaces, what best way to do ?
I was able to call function with the following way :
<p:contentFlow value="#{imagesView.images}" var="image" widgetVar="img">
<p:graphicImage value="/images/imgs/img#{image}.jpg" styleClass="content" onclick="select(#{image})" />
</p:contentFlow>
then in javascript :
function setImageIndex(i){
return;
}
function select(i) {
ContentFlowGlobal.Flows[0].setConfig({onclickActiveItem:setImageIndex});
}
But if I tried this way :
ContentFlowGlobal.Flows[0].setConfig({onclickActiveItem:setImageIndex(i)});
it works but many console errors records, like "onclickActiveItem is not a function" !
So in this way I removed default action that open image itself, and I can do my call using onclick, I want better way to override ContentFlow js, I still think I do thing wrongly.
Any idea what the correct way to override ContentFlow javascript configuration in primefaces?