You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maxim Solodovnik <so...@gmail.com> on 2017/01/19 06:29:55 UTC

Drag/drop multiple items

Hello Sebastien,

I'm trying to implement subj.
JS example I'm using as POC is here [1]
Everything works, except for one thing: no matter how many objects I'm
dropping I only have 1 onDrop() event inside wicket ....

can you help me to fix/workaround this?
Thanks in advance!

[1]
http://stackoverflow.com/questions/793559/grouping-draggable-objects-with-jquery-ui-draggable

-- 
WBR
Maxim aka solomax

Re: Drag/drop multiple items

Posted by Maxim Solodovnik <so...@gmail.com>.
Actually this is good question :)

- selected items are being stored on server

somehow I missed the fact I can do all processing on server
Thanks a lot for the pointer!


On Thu, Jan 19, 2017 at 6:10 PM, Sebastien <se...@gmail.com> wrote:

> Hi Maxim,
>
> Depending of your selection logic, you have 2 ways:
> - a behavior based solution
> - a component based solution
>
> If you can have a wicket component holding the selection (trough its
> model) then opt for a component based solution. The component will be
> passed to #onDrop so its easy to retrieve the selection (because it's the
> component's model). You can use the draggable "helper" to enhance the
> visual dnd ui (example here [1]).
>
> If the selection is client side only, then I think you need to deal with a
> behavior based solution (no wicket component involved). Tell me if it's
> your case, I can try to help out.
>
> Best regards,
> Sebastien.
>
> [1] https://github.com/sebfz1/wicket-jquery-ui/blob/master/
> wicket-jquery-ui/src/main/java/com/googlecode/wicket/
> jquery/ui/interaction/selectable/SelectableDraggableFactory.java#L38
>
>


-- 
WBR
Maxim aka solomax

Re: Drag/drop multiple items

Posted by Sebastien <se...@gmail.com>.
Hi Maxim,

Depending of your selection logic, you have 2 ways:
- a behavior based solution
- a component based solution

If you can have a wicket component holding the selection (trough its model)
then opt for a component based solution. The component will be passed to
#onDrop so its easy to retrieve the selection (because it's the component's
model). You can use the draggable "helper" to enhance the visual dnd ui
(example here [1]).

If the selection is client side only, then I think you need to deal with a
behavior based solution (no wicket component involved). Tell me if it's
your case, I can try to help out.

Best regards,
Sebastien.

[1]
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/interaction/selectable/SelectableDraggableFactory.java#L38

Re: Drag/drop multiple items

Posted by Maxim Solodovnik <so...@gmail.com>.
Thanks for links Sebastien
Unfortunately I need custom selection logic ....
Ill try to check internals of your examples to achieve same results :)

WBR, Maxim
(from mobile, sorry for the typos)

On Jan 19, 2017 16:52, "Sebastien" <se...@gmail.com> wrote:

> Hi Maxim,
>
> The recommended way to dnd multiple items is to use: selectable +
> draggable + droppable
>
> You have 2 examples here:
> http://www.7thweb.net/wicket-jquery-ui/selectable/DraggableSelectablePage
> http://www.7thweb.net/wicket-jquery-ui/selectable/
> TableDraggableSelectablePage
>
> Hope this helps :)
> Sebastien.
>
>

Re: Drag/drop multiple items

Posted by Sebastien <se...@gmail.com>.
Hi Maxim,

The recommended way to dnd multiple items is to use: selectable + draggable
+ droppable

You have 2 examples here:
http://www.7thweb.net/wicket-jquery-ui/selectable/DraggableSelectablePage
http://www.7thweb.net/wicket-jquery-ui/selectable/TableDraggableSelectablePage

Hope this helps :)
Sebastien.

Re: Drag/drop multiple items

Posted by Maxim Solodovnik <so...@gmail.com>.
To be fair I'm not sure :(
This magic is hidden inside DroppableBehavior code :(
And I'm afraid my "drop" handler might be overridden inside
DroppableBehavior.onConfigure

Hopefully Sebastien can help here :)

On Thu, Jan 19, 2017 at 1:48 PM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:

> Can you group them in javascript and detect group in wicket side, for
> example as list of ids?
>
> 2017-01-19 8:29 GMT+02:00 Maxim Solodovnik <so...@gmail.com>:
>
> > Hello Sebastien,
> >
> > I'm trying to implement subj.
> > JS example I'm using as POC is here [1]
> > Everything works, except for one thing: no matter how many objects I'm
> > dropping I only have 1 onDrop() event inside wicket ....
> >
> > can you help me to fix/workaround this?
> > Thanks in advance!
> >
> > [1]
> > http://stackoverflow.com/questions/793559/grouping-
> > draggable-objects-with-jquery-ui-draggable
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Re: Drag/drop multiple items

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Can you group them in javascript and detect group in wicket side, for
example as list of ids?

2017-01-19 8:29 GMT+02:00 Maxim Solodovnik <so...@gmail.com>:

> Hello Sebastien,
>
> I'm trying to implement subj.
> JS example I'm using as POC is here [1]
> Everything works, except for one thing: no matter how many objects I'm
> dropping I only have 1 onDrop() event inside wicket ....
>
> can you help me to fix/workaround this?
> Thanks in advance!
>
> [1]
> http://stackoverflow.com/questions/793559/grouping-
> draggable-objects-with-jquery-ui-draggable
>
> --
> WBR
> Maxim aka solomax
>