arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
ImageRotateAndResize
The widget provides client side methods which can be called with Javascript.
Following methods can be used:
  • rotateLeft(degree) - Rotates the image to the left direction.
  • rotateRight(degree) - Rotates the image to the right direction.
  • resize(width,height) - Resizes the image to the given width and height.
  • scale(scaleFactor) - Scales the image with the given factor.
  • restoreDefaults() - Restores the default image.

Source

<p:growl id="growl" showDetail="true" />

<h:graphicImage id="myImage" value="/resources/images/testImage1.png" />

<pe:imageRotateAndResize id="rotateAndResize" for="myImage" widgetVar="rotateAndResizeWidget">
    <p:ajax event="rotate" listener="#{imageController.rotateListener}" update="growl"/>
    <p:ajax event="resize" listener="#{imageController.resizeListener}" update="growl"/>
</pe:imageRotateAndResize>

<br/>

<p:commandButton icon="ui-icon-arrowreturnthick-1-w" value="Rotate Left"
                 onclick="PF('rotateAndResizeWidget').rotateLeft(90);return false;"/>
<p:commandButton icon="ui-icon-arrowreturnthick-1-e" value="Rotate Right"
                 onclick="PF('rotateAndResizeWidget').rotateRight(90);return false;"/>
<p:commandButton icon="ui-icon-zoomin" value="Scale +"
                 onclick="PF('rotateAndResizeWidget').scale(1.05);return false;"/>
<p:commandButton icon="ui-icon-zoomout" value="Scale -"
                 onclick="PF('rotateAndResizeWidget').scale(0.95);return false;"/>
            
Components and more
Documentation pe:
Attributes (move mouse over the names to see data types)
Name Description
No attributes available for this component.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 15.0.13,PrimeFaces Extensions: 15.0.14-SNAPSHOT,JSF: Apache MyFaces JSF-2.3 Core Impl 2.3.10,Server: Apache Tomcat (TomEE)/9.0.82 (8.0.16),Build time: 2026-02-23 00:32