How to re-render selected area in image area select

Community Driven Extensions Project
Post Reply
atul.raut
Posts: 3
Joined: 25 Jan 2018, 14:47

25 Jan 2018, 14:59

I want to select some portion of image on load event using Image area select.
Is this possible to re-render.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

25 Jan 2018, 19:08

So you want a certain area pre-selected basically?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

atul.raut
Posts: 3
Joined: 25 Jan 2018, 14:47

01 Feb 2018, 07:15

Yes, i want to pre-select image area...

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

01 Feb 2018, 14:31

So looking at the code there are javascript methods on the widget to setSelection.

Code: Select all

PrimeFaces.widgets.widget_areaSelect.setSelection(334,193,334,193);
Here is what the document says:

Code: Select all

/**
     * Set the current selection.
     * This method only sets the internal representation of selection in the plugin instance,
     * it does not update the visual interface.
     * If you want the new selection to be shown, call update() right after setSelection().
     * Also make sure that the show option is set to true.
     *
     * @param {int} x1 X coordinate of the top left corner of the selection area.
     * @param {int} y1 Y coordinate of the top left corner of the selection area.
     * @param {int} x2 X coordinate of the bottom right corner of the selection area.
     * @param {int} y2 Y coordinate of the bottom right corner of the selection area.
     */
    setSelection : function(x1, y1, x2, y2) {
        this.instance.setSelection(x1, y1, x2, y2);
    },
But I can't seem to make it work.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests