ImageStrip widget for 6.2-nightly

Nothing to do with Vaadin, but see e.g.
this page
, or google for “web image formats”.

Quoting from the linked page:

ok,the added images(GIF,jpeg,png) on grid layout are not displaying on Mozillah browser but woriking well on IE,Chrome(is it compatibility problem?)then how to solve this issue?

Some basics:
0) What OS & what version of Mozilla

  1. Check your server logs for Exceptions
  2. Use a tool like Firebug to examine the DOM and to look at the network traffic
  3. Create an Imagestrip in the main window
  4. Embed the same images in you subwindo

steve

IS it possible if you could post sample implementation as Iam getting NullPointerException as well at readImageResource(ImageStrip.java:592)…

here is my code:

imageStrip = new ImageStrip();
File img= new File(“/projects/rasp/uploads/pdf1.jpg”);
FileResource fr = new FileResource(img, getApplication());

    imageStrip.setAnimated(true);

    // Make imageStrip to behave like select
    imageStrip.setSelectable(true);

    // Set size of the box surrounding the images
    imageStrip.setImageBoxWidth(140);
    imageStrip.setImageBoxHeight(140);

    // Set maximum size of the images
    imageStrip.setImageMaxWidth(125);
    imageStrip.setImageMaxHeight(125);
    imageStrip.addListener(this);
    imageStrip.addImage(fr);
	verticalSplitPanel.setSecondComponent(imageStrip);

Great work Peter!

Is it possible to add captions?

Hi Peter!

Very nice Add-on! :wink: But I still miss the possibility to add a label to the images! This feature would be great!

Thanks!

Florian

I can’t get it to animate. Everyone got it to animate?

Hi Peter,

I use ImageStrip in a Vaadin Portlet Application in Liferay and it works as expected. The only issue i see is after the page has finished loading (all pictures are shown) first click into the ImageStrip (select Picture or push next/previous button) initiates a server request lasting about 60seconds (and i connot figure out what is going on there). After the first request ended all subsequent navigation with the ImageStrip works immediately.

When i set a breakpoint in my Portlet (extending VaadinPortlet) the breakpoint gets called after the 60seconds, so i think the delay is occuring on the client side (between clicking into ImageStrip and request arriving at the server).

With firebug i can see that the first request is:
…: /UIDL/
p_p_cacheability: cacheLevelPage
p_p_col_count: 1
p_p_col_id: column-1
p_p_id:

p_p_lifecycle: 2
p_p_mode: view
p_p_resource_id: APP
p_p_state: normal
v-uiId: 0

The request post data is:
03759ef1-6762-4c85-a1a9-4dd95feca711[[“0”,“com.vaadin.shared.ui.ui.UIServerRpc”,“resize”,[“1286”,“1160”,“1633”,“494”]
],[“994”,“com.vaadin.shared.ui.gridlayout.GridLayoutServerRpc”,“layoutClick”,[{“altKey”:false, “relativeX”:“349”, “relativeY”:“1”, “type”:“8”, “shiftKey”:false, “button”:“LEFT”, “clientY”:“460”, “metaKey”:false, “clientX”:“349”, “ctrlKey”:false},“995”]
]]

And the request response data is:
for(;;);[{“changes” :
, “state”:{}, “types”:{“996”:“11”}, “hierarchy”:{“996”:}, “rpc” :
, “meta” : {}, “resources” : {}, “timings”:[4401, 0]
}]

Can anybody tell me where to search for the issue?

Regards
Michael

Hi ,

I’m getting the following warning while running the below code
Widgetset ‘com.vaadin.DefaultWidgetSet’ does not contain implementation for org.vaadin.peter.imagestrip.ImageStrip. Check its component connector’s @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.
Previously I use to get NullPointerException

protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
ImageStrip strip=new ImageStrip();
strip.setAnimated(true);
strip.setSelectable(true);
strip.setImageBoxWidth(140);
strip.setImageBoxHeight(140);
strip.setImageMaxWidth(125);
strip.setImageMaxHeight(125);
layout.addComponent(strip);
File img= new File(“/home/guts/Pictures/bugs.jpg”);
FileResource fr = new FileResource(img);
strip.addImage(fr);

Could anybody tell me where I’m going wrong ?

Hi Sivaram,

you have to build your own widget set.

https://vaadin.com/book/vaadin6/-/page/gwt.widgetset.html


https://vaadin.com/book/vaadin7/-/page/clientside.compiling.html

Thanks for the help . I have compiled the widget set and now I have TestuiWidgetset.gwt.xml in my project . But it is still giving the same warning .
Widgetset.gwt.xml looks as follows .


Has it fixed I am having the same problem :frowning:

Hi,

I think you don’t use your WidgetSet. If your widgetset only inherits org.vaadin.peter.imagestrip.ImageStripApplicationWidgetset, all vaadin’s UI components should not be loaded.

First your widgetset should look like this:

[font=courier new]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet" />
    <inherits name="org.vaadin.peter.imagestrip.ImageStripApplicationWidgetset" />
</module>
[/font]

Second check your loaded resources in your web browser (F12 => Network) and look at the widgetset being loaded. There should be a JavaScript file named like …/VAADIN/widgetsets/my.company.widgetset.MyWidgetSet/my.company.widgetset.MyWidgetSet.nocache.js?1411630764288. Of course names and nocache-Parameter varies. If the standard vaadin widgetset is not loaded, check your web container configurations.

Hi Frans,
I’m trying to use you StripImage modification without success. Could you please send me the complete modification codebase as you purpose ?
Many thanks

Hi All ,
still i am getting NP , when add images , can you please give me piece of code. that would help me.

// Add few images to the strip using different methods
    strip.addImage("navigation/NavigationBarImages/ConfigureToolbar.png");

We got an error when we add image (external resource) form HTTPS with version 3.0.

I’v attached file for problem description.

The problem is on ImageTools.resizeImage method when getting image :
BufferedImage sourceImage = ImageIO.read(new URL(url));

That does’nt work with HTTPS Url.

Thanks for help.
21148.txt (2.59 KB)

Jai Soni Soni

Please can you share you code changes for new features added.

Finally we don’t use ImageStrip.

Hey,
I just wanna add the imageStrip to a window but it doesnt work for me.
here is my code
:public Window formini(Resource res){
// Create a sub-window and set the content
Window subWindow = new Window(“Sub-window”);
subWindow.addStyleName(“surimp”);
subWindow.setModal(true);
//HorizontalLayout subContent =new HorizontalLayout();

    ImageStrip imageStrip = new ImageStrip();
    imageStrip.setAnimated(true);
    
    String basepath = VaadinService.getCurrent()
            .getBaseDirectory().getAbsolutePath();
    String lien=basepath+"/images/1.jpg";
    FileResource resource = new FileResource(new File(lien));
    imageStrip.addImage(resource);
    imageStrip.addImage(resource);
    imageStrip.addImage(resource);
    imageStrip.addImage(resource);
    imageStrip.setSelectable(true);    
    subWindow.setContent(imageStrip);
    return subWindow;
    
}

and this is my init():

image.addClickListener(event ->{

            SuperposedForm spf=new SuperposedForm();
            addWindow(spf.formini(resource));
            }
        );

in the attachement, you will fing what i got after execution.
thanks Mrs
28303.jpg

Hi,
I downloaded jar and i can invoke getImages() method.
But if I get addon with dependency maven, this method is not present. ( getImages() is undefined for the type ImageStrip)

Why ??

Thank you