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 <[email protected]> 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 <DIV>. > 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 <ul></ul> 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 <DIV><ul><li></il></ul<DIV> is outside the WebMarkupContainer. > > Here is the snippet from the html: > <wicket:panel> > <div wicket:id="pageContainer"><div class="mainPageDiv" > wicket:id="mainPage"></div></div> > > <div class="menuDiv"> > <ul> > <li class="mainMenuItem" wicket:id="topItem_CM_Information"></li> > <li class="subMenuItem" wicket:id="subItem_holdings"> # </li> > <li class="subMenuItem" wicket:id="subItem_holdings_at_day_end"> # </li> > <li class="subMenuItem" wicket:id="subItem_holdings_update"> # </li> > </ul> > </div> > </wicket:panel> > > (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: [email protected] > For additional commands, e-mail: [email protected] > > -- Pedro Henrique Oliveira dos Santos
