You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Chris Turchin <ch...@turchin.net> on 2012/07/18 19:06:55 UTC

wicket tree + wiquery ajax draggable + droppable behavior

hi,

we have a wicket 1.5.7 tree (org.apache.wicket.extensions.markup.html.tree)
that we are loading subnodes into via ajax. the tree supports ajax dnd
events using wiquery (dnd to copy/move/link page objects into the tree
nodes) and it works great when the page loads (e.g at level one in the
tree).

when we add subnode (level two) to the tree via ajax (lazy loading nodes),
these nodes are at first not droppable. after loading an additional
sublevel (level three), then the nodes of  level two are droppable. the
level three nodes are not. and this continues down the tree level by
level... alternately, when the page is refreshed (f5) all nodes in the tree
are droppable.

i know that jquery brings a live() function for reacting to ajax-y DOM
changes. i cannot figure out how this plays into the wiquery context or how
we can get the ajax nodes to be ui-droppable right after loading.

advice appreciated. thanks.

best regards
-chris

-- 
Chris Turchin <ch...@turchin.net>

Re: wicket tree + wiquery ajax draggable + droppable behavior

Posted by Chris Turchin <ch...@turchin.net>.
to get this to work, we ended up having to refresh the entire tree
component when the children of a node are loaded, kinda defeating the
purpose of the ajax lazy loading. otherwise, the subnodes are not droppable
targets in the DOM.

still open to better more jq/wiquery-like approach if someone has any ideas.

thanks.
-c

On Wed, Jul 18, 2012 at 7:06 PM, Chris Turchin <ch...@turchin.net> wrote:

> hi,
>
> we have a wicket 1.5.7 tree
> (org.apache.wicket.extensions.markup.html.tree) that we are loading
> subnodes into via ajax. the tree supports ajax dnd events using wiquery
> (dnd to copy/move/link page objects into the tree nodes) and it works great
> when the page loads (e.g at level one in the tree).
>
> when we add subnode (level two) to the tree via ajax (lazy loading nodes),
> these nodes are at first not droppable. after loading an additional
> sublevel (level three), then the nodes of  level two are droppable. the
> level three nodes are not. and this continues down the tree level by
> level... alternately, when the page is refreshed (f5) all nodes in the tree
> are droppable.
>
> i know that jquery brings a live() function for reacting to ajax-y DOM
> changes. i cannot figure out how this plays into the wiquery context or how
> we can get the ajax nodes to be ui-droppable right after loading.
>
> advice appreciated. thanks.
>
> best regards
> -chris
>
> --
> Chris Turchin <ch...@turchin.net>
>



-- 
Chris Turchin <ch...@turchin.net>