galleria and graphicImage with StreamedContent do not work

UI Components for JSF
Post Reply
gokmem
Posts: 2
Joined: 18 Feb 2011, 13:58

21 Nov 2011, 10:46

I'm using galeria and graphicimage component with StreamedContent. But it does work.

Bean function is:

Code: Select all

public List<ImageObject> getImageListStreamedContent()throws Exception{
		List<ImageObject> images = new ArrayList<ImageObject>(); 
		FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();

        String path = externalContext.getRealPath("/pages/images");
        
		for(int i=1;i<=12;i++) {  
			ImageObject io = new ImageObject();
			InputStream inputStream = new FileInputStream(path+"\\Fotograf-0006.jpg");
			io.setId(i);
			io.setContent(new DefaultStreamedContent(inputStream, "image/jpg"));
            images.add(io); 
        }  
        return images;
	}
ImageObject is :

Code: Select all

package com.keysint.common.object;

import org.primefaces.model.StreamedContent;

public class ImageObject {
	private int id;
	
	private StreamedContent content;

	public ImageObject() {
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public StreamedContent getContent() {
		return content;
	}

	public void setContent(StreamedContent content) {
		this.content = content;
	}
	
	
}

and xhtml code id:

Code: Select all

<h:form id="form" prependId="false">
<p:galleria value="#{noticeBean.getImageListStreamedContent()}" var="image">
                <p:graphicImage value="#{image.content}" title="#{image.id}"/>
         </p:galleria>
</h:form>
These code does not work. Eclipse show "Error in streaming dynamic resource" warning.
Any idea?

publichi
Posts: 4
Joined: 14 Dec 2011, 00:59

27 Dec 2011, 01:17

does it work now?

i have the same problem

jamesarbrown
Posts: 22
Joined: 15 Dec 2010, 21:04

04 Feb 2012, 20:16

Hi,

Having trouble with this myself. Posted a bug here http://code.google.com/p/primefaces/iss ... il?id=3446

James

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 56 guests