imagecropper issue

UI Components for JSF
Post Reply
koorosh01
Posts: 1
Joined: 06 Nov 2010, 10:25

06 Nov 2010, 10:54

hi
i have a page that contains image cropper element , i have configured prime faces on my project based on tutorials on web . it seems that everything is working fine .
but the main problem is in my back bean class.

Code: Select all

public class MyBean {

	private CroppedImage croppedImage ;
        .....
        public CroppedImage getCroppedImage() {
		return croppedImage;
	}

	public void setCroppedImage(CroppedImage croppedImage) {
		this.croppedImage = croppedImage;
	}

public String crop() {
		
		if(croppedImage == null)
			return null;

		FileImageOutputStream imageOutput;
		try {
			imageOutput = new FileImageOutputStream(new File("croped.jpg"));
			imageOutput.write(croppedImage.getBytes(), 0,
					croppedImage.getBytes().length);
			imageOutput.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		return null;
	}
        ....
}
there is a <p:commandButton /> on my page that is bind to my bean and crop method executes . but always croppedImage is null.
am i missing something ?

i am using primefaces 1.02 , richfaces 3 .

averri
Posts: 136
Joined: 07 Sep 2009, 15:51
Location: Brazil

20 Feb 2011, 21:52

I have the same problem.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 44 guests