views:

549

answers:

2

Hello,

I'm currently working on a GWT project, in which I need to use a "carousel" widget. The carousel widget is supposed to display pieces of information and 2 arrows - when the user clicks on one of the arrow, the content is moved with an animation and replaced with new content.

I've been looking through the available widget libs, but the "carousel" widget does not seem to be that available. The only real candidate I found is the gwt-yui-carousel widget (see link below), but this seems to be an overload of ressources - though it does almost exactly what I need, but instead of displaying simple images, I'll have to display, in MVP terms, a view/presenter.

Here is the widget running : http://gwt-yui-carousel.googlecode.com/svn/trunk/www/com.gwtyuicarousel.javascriptload.JavaScriptLoad/javascriptload.html

(coming from here : http://code.google.com/p/gwt-yui-carousel/ ).

Is there a better carousel widget available that I would not know of ? Or should I extend an existing one to create the desired effect ? Would you recommend to use the gwt-yui-carousel (I don't think so) ? If there is no better option, do you think that it would be a good idea to create the widget myself ?

Note that I think that the key thing is, here, that I'll have to display presenter/views, which will fetch data in DataBase on arrow clicks and so on - so a customisation of an existing widget would be required, or the chosen widget should be able to display a list of GWT Widgets.

Again I don't think that I can use one of the existing usual carousel widgets, since those are not "gwt-oriented" and could not support view/presenters and all this gwt stuff ;)

Any answer would be greatly appreciated :)

Best regards,

Nils

A: 

Don't know of any available implementation but you can write this widget in no time.

Create a widget holding a list of URLs (your images):

CarouselWidget(ArrayList<String> urls) extends HorizontalPanel

then add to the panel two buttons and the desired images to show.

Left button / image / image / image ... / image / Right button

The images are feed from your url list and when the left or right button is clicked you move the starting index -- or ++ ... and refresh the image view.

From the starting index you calculate the "real" index in your array.

Drejc
+1  A: 

http://code.google.com/p/spiral-carousel-gwt/

kr