Hi Christian, the appended JavaScript with
AjaxReuqestTarget#appendJavascript already will be called after tree
DOM update. Try to postpone your scroll JavaScript wrapping it in an
function to setTimeout method.

On Mon, Jun 6, 2011 at 10:38 AM, Christian Mader
<christian.ma...@univie.ac.at> wrote:
> Hello,
>
> I have an ajax link and a tree located at the same page. When I click on the
> link I want the tree to expose a specific item and scroll the item into
> view.
> Exposing the item works well using getTreeState().expandNode(childNode); and
> after adding the tree component to the AjaxRequestTarget it displays
> properly.
> I append javascript code to the AjaxRequestTarget to scroll to the expanded
> item, but this only works if the tree is already completely expanded.
> Otherwise, the scroll location is not correct.
>
> I assume this is because the scroll js command is issued before the tree is
> completely expanded. Is there any possiblity to wait for the tree to be
> displayed and then issue the scroll command? Would overriding
> onAfterRender() help on this issue? How can I get an AjaxRequestTarget in
> onAfterRender()?
>
> I would be happy for any reply that points me into the right direction to
> solve this problem.
>
> Best,
> Christian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Pedro Henrique Oliveira dos Santos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to