Carousel functionality

UI Components for JSF
Post Reply
winstona
Posts: 35
Joined: 31 Jan 2011, 23:55

17 Feb 2011, 19:41

I have a list which i am passing to carousel component and having 'n' number of slides. When i click on next button, it navigates to the next slide. I would like to store the data of current slide, when the user clicks on next button (which is there on top right corner of carousel). Is there any onclick functionality available in carousel of primefaces? If not, how can we do that using javascript?

Also how can i remove the default button icons appearing on the header of carousel?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

17 Feb 2011, 19:44

There is no callback for pagination yet, feel free to submit a feature request.

winstona
Posts: 35
Joined: 31 Jan 2011, 23:55

18 Feb 2011, 15:50

Thanks. can we do that using javascript?

i would like to remove the page buttons on the top of carousel and keep only next/back buttons.
How i do change/remove the button icons appears on the top of carousel?


Regards
Winston

fwelland
Posts: 5
Joined: 06 Jan 2012, 16:16

06 Jan 2012, 16:25

maybe it is too late for you but this is what I did:

Code: Select all

<p:carousel widgetVar="rnd" rows="1" itemStyle="height:50px;width:400px;" effect="easeInStrong" >
    //blah blah blah
</p:carousel>

<p:commandButton value="next"  type="button" onclick="n();"/>
<p:commandButton value="prev"  type="button" onclick="p();"/>

<f:verbatim>
<script type="text/javascript">    
//<![CDATA[    

function n()
{
    rnd.nextButton.click(); 
}

function p()
{
    rnd.prevButton.click();         
}

//]]>
</script>
I used styles and got rid of all the header and buttons stuff on the top. Now javascript can control the back and forth movement of the carousel tabs...

I need to one up this, as I know I always have 3 tabs in my carousel: 'a', 'b', 'c' and instead of n() and p() , I'd like to got to 'b' or go to 'c' (or back 'a') without having to remember where i am and which direction to go..

HTH: btw: PrimeFaces 3.0 general release.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests