Hi David, you can specify your css for clicked links wiht the pseudo-class
:visited, also you can send back to browser only the javascript needed to
style the clicked links, like:
request.appendJavascript("Wicket.$('linkId').style.someProperty = 'some
value'");
On Wed, Dec 1, 2010 at 8:56 AM, drf wrote:
>
> I have an issue whereby an ajax update on a WebMarkupContainer is having
> unexpected effect on content outside the container.
>
> The page in question consists of two parts:
> 1. on the left hand side, a menu, composed of a list of AjaxFallbackLink
> objects. This is contained in a .
> 2. on the right hand side, a panel, which itself is contained in a
> WebMarkupContainer.
>
> Here is standard behavior:
> When a link is clicked, it's color changes to indicate it is selected
> (achieved by using AttributeModifier to change the css class). Also, the
> content of the panel changes. Works fine.
>
> Here is the issue:
> when the list is long, a scrollbar appears in the DIV surrounding
> it (which is correct). I want to avoid the scrollbar moving back to the top
> of the list when an item is clicked, so rather than doing an update on the
> whole page, I use ajax to update just:
> 1. The selected link
> 2. The previously selected link
> 3. The WebMarkupContainer containing the panel (which will now have new
> content).
>
> If I just do an update on the two AjaxFallbackLink objects, there is no
> problem, and the DIV does not scroll back to the top. However, when I do an
> update on the WebMarkupContainer, the DIV does scroll back to the top -
> even
> though the is outside the WebMarkupContainer.
>
> Here is the snippet from the html:
>
> wicket:id="mainPage">
>
>
>
>
> #
> #
> #
>
>
>
>
> (I have removed most of the list items for the sake of brevity).
> Here is a snippet from the java:
>Panel mainPage = new SimplePage("mainPage");
>mainPageContainer = new WebMarkupContainer("pageContainer");
>mainPageContainer.setOutputMarkupId(true);
>add(mainPageContainer);
> mainPageContainer.add(mainPage);
>
> The list items are then added as AjaxFallbackLink objects.
> As always, help greatly appreciated !
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/WebMarkupContainer-update-affecting-scrollbar-which-is-outside-container-tp3067035p3067035.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos