wood burning stoves 2.0*
The moose likes JSF and the fly likes Using imageCropper with JSF and primefaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Using imageCropper with JSF and primefaces" Watch "Using imageCropper with JSF and primefaces" New topic
Author

Using imageCropper with JSF and primefaces

Marcelo Tataje
Ranch Hand

Joined: Jan 31, 2011
Posts: 64

Hello everybody, I've been racking my brain for three days with a problem I cannot solve, it's about JSF and primefaces... what I want to do to begin is simple. I have my index.xhtml page which has a button, the button forwards to a page where there's an image and a cropper which is implemented with primefaces (p:imageCropper). When I access the page I can see the pointer of the cropper and also select an area, the problem is when I call the "Crop" command button because nothing happens it even doesn't calls my action (managed bean) but what is weird is that a message is shown under my form and says: Conversion error occurred
I'm pasting the code of my xhtml and my managed bean class:

image-preview.xhtml



ImageCropperBean.java



I don't know what to do, I'm working with Eclipse Helios and the image I'm using is inside the WebContent folder, that's why I'm calling it directly. I thought that the problem could be my java class but it cannot be since I have a System.out.println("Inside crop") and it's there's nothing on console. I don't know if the problem is primefaces.

Another thing is that in all the examples I have seen on the web, the import for cropped image in the class is: org.primefaces.ui.component.imagecropper.CroppedImage;
while in my case I just have: org.primefaces.model.CroppedImage

Could it be that the problem?

Libraries I'm using are the following:

el-api-1.1jar
el-impl-1.1
jsf-api.jar
jsf-impl.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar
primefaces-2.2.jar

I hope somebody could help me please, I'd be very grateful. Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using imageCropper with JSF and primefaces