ADF 11g : Carousel going round and round (..and round and..)

Luc Bors 2

Mostly when you see a carousel-ish component on the internet, it is automatically showing the next entry after a few seconds. I wondered if this could be done with the ADF carousel component as well.
And guess what

In one of my posts on this weblog I already explained how to implement an ADF carousel component. I managed to add the autoSpin functionallity to the carousel by simply adding a poll component to the page. This component has a pollListener attribute that you can bind to a backing bean method.

            <af:poll pollListener="#{carouselBean.autoSpin}"
                         interval="2000" />

In this method ( autoSpin() ) you need to be able to invoke methods on the CountriesViewIterator
These (next and first) refer to action bindings in the page Definition. If they are not in there yet, just add them by copy/paste the code below.

    <action IterBinding="CountriesViewIterator"
    <action IterBinding="CountriesViewIterator"

In this method it is very easy to implement logic that forces to invoke the Next operation on the iterator that holds the data for the carousel.
Make sure to invoke the First operation whenever you are at the last record (!hasNext()).

Finally invoke the refreshCarousel() method, that adds the carousel as a partialTarget so it will be refreshed.

  public void autoSpin(PollEvent pollEvent) {
    // Add event code here...

    DCIteratorBinding countryIt =

    RowSetIterator countryRSI = countryIt.getRowSetIterator();

    OperationBinding operationBinding = null;
    operationBinding =
    else {
      operationBinding =
     Object execute = operationBinding.execute();



The spinning is nice (not yet too smooth…) and will go on forever. I added a checkbox to be able to stop the spinning if necessary.

Spinning in action and downloadable workspace.

I uploaded a movie with the spinning in action. See here for the Spinning Carousel.
You can download the JDeveloper workspace here.

2 thoughts on “ADF 11g : Carousel going round and round (..and round and..)

  1. It’s great but lost the animation effect. And cause carousel component refresh after every poll. I’ve tried to use javascript call next and pervious instead. It’s just work fin.
    Call javascript like <carousel component>.getPeer()._initiateSpinNextAnimation();

Comments are closed.

Next Post

Automatic testing Oracle Service Bus using Jenkins, maven and SoapUI

A lot of current projects are implementing some sort of service based architecture. Testing in this architecture becomes more complex. When implementing an OSB project with Scrum you test-automation is imperative. Scrum will require more frequent testing of your system. This is only feasible (in time and money) when you […]
%d bloggers like this: