Locale

Change the locale of the datepicker, schedule and client side validation messages.

Language
English
English
English
French
German
German
German
Italian
Korean
Spanish
Catalan
Dutch
Portuguese
Portuguese
Arabic
Arabic
Bulgarian
Bangla
Bosnian
Czech
Greek
Estonian
Persian
Finnish
Danish
Hindi
Indonesian
Icelandic
Croatian
Japanese
Hungarian
Hebrew
Georgian
Central Kurdish
Khmer
Kyrgyz
Kazakh
Lithuanian
Latvian
Malay
Norwegian
Polish
Romanian
Russian
Slovak
Slovenian
Serbian
Serbian
Swedish
Thai
Turkish
Ukrainian
Uzbek
Vietnamese
Chinese
Chinese

Input Style

Themes

PrimeUIX
Aura Light Emerald Aura Light Emerald
Aura Dark Emerald Aura Dark Emerald
PrimeOne
Saga Blue Saga Blue
Vela Blue Vela Blue
Arya Blue Arya Blue
Bootstrap
Bootstrap Blue Light Bootstrap Blue Light
Bootstrap Purple Light Bootstrap Purple Light
Bootstrap Blue Dark Bootstrap Blue Dark
Bootstrap Purple Dark Bootstrap Purple Dark
Material Design
Material Indigo Light Material Indigo Light
Material Deep Purple Light Material Deep Purple Light
Material Indigo Dark Material Indigo Dark
Material Deep Purple Dark Material Deep Purple Dark
Material Design Compact
Material Compact Indigo Light Material Compact Indigo Light
Material Compact Deep Purple Light Material Compact Deep Purple Light
Material Compact Indigo Dark Material Compact Indigo Dark
Material Compact Deep Purple Dark Material Compact Deep Purple Dark
Legacy
Nova Light Nova Light
Nova Dark Nova Dark
Nova Colored Nova Colored
Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink

ImageCropper

ImageCropper is used to extract a certain part of an image to create a new image.

ImageCropper Tag Documentation

ImageCropper allows cropping a certain region of an image. A new image is created containing the cropped area and assigned to a CroppedImage instanced on the server side.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
alt String false Alternate text of the image.
aspectRatio double false 0.0 Aspect ratio of the cropper area.
boxHeight int false 0 Maximum box height of the cropping area.
boxWidth int false 0 Maximum box width of the cropping area.
cache boolean false true Controls browser caching mode of the resource.
converter Converter false EL expression resolves to a converter instance or literal converter ID defining a component converter.
converterMessage String false
guides boolean false true Show the dashed lines in the crop box.
image Object true Binary data to stream or context relative path.
immediate boolean false false When set true, process validations logic is executed at apply request values phase for this component.
initialCoords String false Initial coordinates of the cropper area (x, y, width,height).
maxSize String false Maximum size of the cropper area (width,height).
minSize String false Minimum size of the cropper area (width,height).
required boolean false false Marks component as required.
requiredMessage String false
responsive boolean false true Re-render the cropper when resizing the window.
sizeLimit Long false 10485760L Maximum number of bytes the image.
submittedValue Object false
validator Validator false A method expression referring to a method validating the input.
validatorMessage String false
value Object false Value of the component.
valueChangeListener ValueChangeListener false A method binding expression referring to a method for handling a valuchangeevent.
viewMode int false 1 Define the view mode of the cropper. ViewMode 0 is not supported. A value of 1, 2 or 3 will restrict the crop box to the size of the canvas. ViewMode of 2 or 3 will additionally restrict the canvas to the container. Note that if the proportions of the canvas and the container are the same, there is no difference between 2 and 3.
zoomOnTouch boolean false true Enable to zoom the image by dragging touch.
zoomOnWheel boolean false true Enable to zoom the image by wheeling mouse.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc Basic Dynamic FileUpload

Usage


<div class="card">
    <h:form>
        <p:growl id="msgs" showDetail="true"/>

        <h:panelGrid columns="2" cellpadding="7">
            <p:imageCropper value="#{cropperView.croppedImage}"
                            image="/resources/demo/images/nature/nature6.jpg"
                            initialCoords="225,75,300,125"
                            minSize="100,100"
                            maxSize="250,250"
                            zoomOnWheel="false"/>
            <h:panelGroup id="cropped">
                <p:graphicImage rendered="#{not empty cropperView.newImageName}"
                                name="demo/images/crop/#{cropperView.newImageName}.jpg"/>
            </h:panelGroup>
        </h:panelGrid>

        <p:commandButton value="Crop" action="#{cropperView.crop}" update="cropped msgs" styleClass="mt-3" />
    </h:form>
</div>