Code: Select all
<p:dialog widgetVar="photoDialog" modal="false" header="Foto" position="center" height="600" >
<h:form id="photoForm">
<h:panelGrid id="pgCropper" columns="1">
<p:imageCropper id="cropper" value="#{studentBean.croppedImage}"
image="#{studentBean.photoPath}" initialCoords="10,10,150,150" />
<h:panelGroup>
<p:commandButton value="Cortar" action="#{studentBean.crop}"
update="photoPanelForm:photo,cropper" />
<p:commandButton value="Salvar original"
action="#{studentBean.crop}"
update="photoPanelForm:photo,cropper" />
<p:commandButton value="Cancelar" oncomplete="photoDialog.hide();"
update="photoPanelForm:photo,cropper" />
</h:panelGroup>
</h:panelGrid>
</h:form>
</p:dialog>