Hi,
I'm using Primefaces in a seam application, i got a issue with p:imageCropper, here goes the issue description.
<p:imageCropper value="#{myImageCropper.croppedImage}" image="http://localhost/myWork/uploader/images/#{param['studentID']}.jpg"/>
if I pass the student ID as parameter to the page, action of
<p:commandButton value="Crop" action="#{myImageCropper.crop}" async="true" update="croppedImage"/>
will never get called, nothing works, how ever if i pass the actual image name hard coded like shown below
<p:imageCropper value="#{myImageCropper.croppedImage}" image="http://localhost/myWork/uploaded/images/STUDID001.jpg"/>
everything works fine, image gets croped and will be saved properly, if any one can help me resolving this issue it will be great.
Thanks in advance
ansar
Stuck with p:imageCropper
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
What does imagecropper render as html when you try to pass a parameter?
-
- Posts: 8
- Joined: 11 May 2010, 19:48
Hi Cagatay,
Thanks for your reply, if i pass the parameter, imagecropper properly renders/displays the image cropper (it displays correct student image),
now if I click crop p:commandButton, nothing happens. For my experimentation I replaced p:commandButton with h:commandButton then i get
error saying that it cannot convert the parameter passed (error printstack trace does not appear on console i just get error message on page).
I badly need some help here, i'm really stuck here not moving.
thanks
ansar
Thanks for your reply, if i pass the parameter, imagecropper properly renders/displays the image cropper (it displays correct student image),
now if I click crop p:commandButton, nothing happens. For my experimentation I replaced p:commandButton with h:commandButton then i get
error saying that it cannot convert the parameter passed (error printstack trace does not appear on console i just get error message on page).
I badly need some help here, i'm really stuck here not moving.
thanks
ansar
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
I think I got it, during crop process imagecropper tries to read the image, as your image path is based on a request parameter, it can't read it as it's a different request now. Try using a more stateful scope like view scope.
-
- Posts: 8
- Joined: 11 May 2010, 19:48
Wow, it worked by getting the values from view scope, you saved my life and harrasment with the customer, thanks a lot buddy.
I know it was my mistake not Primeface components, even then you spent time I really appritiate, and Primefaces ROCKS !!!!!!
Its simply tooooooooooooooooooooo good.
Thanks
ansar
I know it was my mistake not Primeface components, even then you spent time I really appritiate, and Primefaces ROCKS !!!!!!
Its simply tooooooooooooooooooooo good.
Thanks
ansar
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Glad it works ansar, enjoy PrimeFaces.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 10 guests