melistik / vaadin-jcrop

Vaadin wrapping for the jQuery plugin jCrop
https://vaadin.com/directory#!addon/jcrop-wrapper
MIT License
3 stars 2 forks source link

setSelection does not work on initial load #6

Open tadev-au opened 8 years ago

tadev-au commented 8 years ago

The setSelection method only seems to work when the component is already visible. There is the following comment in the setSelection source code: "set the selection of Jcrop programmatically is only working when the component is already attached to the screen"

My use case is that a user can select and area of an image and the selection coordinates are saved to a database. At a later stage the user should be able to come back and modify the selection and I can't seem to find a way to load the jcrop area with a selection already applied to it.

Is there a way to initialize jcrop with a certain selection that is immediately shown when the component is first loaded? Or is there some kind of workaround to achieve this?

This would be a very useful feature for me.

Thanks for providing the awesome add-on.

janzankowski commented 8 years ago

+1 - Same use case as above.