arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
ImageAreaSelect
It's also possible to combine ImageAreaSelect and ImageRotateAndResize.

With the imageRotateAndResize widget, the image will be completely redrawn and the ImageAreaSelect will stop working after a resize or rotate action. We can simply fix this with call reload() of the ImageAreaSelect Javascript widget. If you don't need a listener for the resize or rotate event on the server, you could use pe:javascript to reload the ImageAreaSelect widget. In this example the resize event is also catched with pe:javascript.
Source

<p:outputPanel id="example">
    <p:commandLink update="example">
        <f:setPropertyActionListener target="#{imageController.imageUrl}" value="/resources/images/testImage1.png" />
        <p:graphicImage value="/resources/images/testImage1.png" width="150" height="100"/>
    </p:commandLink>
    <p:commandLink update="example">
        <f:setPropertyActionListener target="#{imageController.imageUrl}" value="/resources/images/testImage2.png" />
        <p:graphicImage value="/resources/images/testImage2.png" width="150" height="100"/>
    </p:commandLink>
    <p:commandLink update="example">
        <f:setPropertyActionListener target="#{imageController.imageUrl}" value="/resources/images/testImage3.png" />
        <p:graphicImage value="/resources/images/testImage3.png" width="150" height="100"/>
    </p:commandLink>

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

    <div id="imageWrapper" style="width:600px; height:400px; margin:auto; overflow:scroll; position:relative;">
        <p:graphicImage id="myImage" value="#{imageController.imageUrl}" />
    </div>

    <pe:imageAreaSelect id="areaSelect"
        for="myImage"
        widgetVar="areaSelectWidget"
        autoHide="true"
        handles="false"
        movable="false"
        persistent="false"
        resizable="false"
        parentSelector="#imageWrapper">
        <p:ajax event="selectEnd" listener="#{imageController.selectEndListener}" update="growl"/>
    </pe:imageAreaSelect>

    <pe:imageRotateAndResize id="rotateAndResize" for="myImage" widgetVar="rotateAndResizeWidget">
        <p:ajax event="rotate" listener="#{imageController.rotateListener}"
                update="growl" oncomplete="PF('areaSelectWidget').reload();"/>
        <pe:javascript event="resize" execute="PF('areaSelectWidget').reload();"/>
    </pe:imageRotateAndResize>

    <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;"/>
</p:outputPanel>
            
Components and more
Documentation
Attributes (move mouse over the names to see data types)
Name Description
aspectRatioAspect ratio of the selection (e.g. '1:1').
autoHideWhether to auto-hide the selection.
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
fadeSpeedFade speed in ms.
forSearch expression for the target image to attach the area selector to.
handlesWhether to show resize handles.
hideWhether to hide the selection on click outside.
idUnique identifier of the component in a namingContainer.Default is generated.
imageHeightImage height for coordinate mapping.
imageWidthImage width for coordinate mapping.
keyboardSupportWhether keyboard support is enabled.
maxHeightMaximum selection height.
maxWidthMaximum selection width.
minHeightMinimum selection height.
minWidthMinimum selection width.
movableWhether the selection is movable.
parentSelectorParent selector for the widget.
persistentWhether the selection is persistent.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
resizableWhether the selection is resizable.
showWhether to show the selection on init.
widgetVarName of the client side widget.
zIndexz-index of the selection overlay.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-03-08 21:04