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?
I found better and cleaner way from my previous first way I used and guaranteed way and clearer, by using AddOn, like this :
Full documentation of ContentFlow can be found in this link: http://www.jacksasylum.eu/ContentFlow/docu.php , you can do alot of customization then.
P.S.:
ma()
is thename
ofp:remoteCommad
so I can pass variables to backbean.My issue solved like this, and I'm satisfied with this way, I hope I share something helpful for someone else later.