I thought Alfonso's cookie suggestion sounded workable. Have JS keep the
current accordian state there, and you can grab it server-side in
your accordion's onBeforeRender. A cookie naming strategy that works
generally might be tricky (does it include the page mount? version?
component ID?). But you could probably make an "engineering compromise"
that works.

There's probably an uglier jQuery solution that updates all link targets in
the page when your accordian gets clicked. :)

On Thu, Mar 22, 2012 at 2:35 PM, Igor Vaynberg <igor.vaynb...@gmail.com>wrote:

> ah. well, if you want it to be preserved across link clicks then you
> have to keep the state on the server. you wouldnt have to if the links
> were ajax and were not repainting the accordion.
>
> -igor
>
>
> On Thu, Mar 22, 2012 at 2:33 PM, Alfonso Quiroga <alfonsose...@gmail.com>
> wrote:
> > Are you sure when the page changes the hash is keeped? Maybe I did not
> > express correctly, when I typed "refresh the page" I wanted to say
> > "when you click a link and wicket renders the page again". I think
> > when you click any link, a new url is generated without the hash.
> > Thanks anyway
> >
> > On Thu, Mar 22, 2012 at 1:28 PM, Igor Vaynberg <igor.vaynb...@gmail.com>
> wrote:
> >> add the state to the hash of the page. and when initializing accordion
> >> check the hash and restore it. this should survive page refreshes.
> >>
> >> -igor
> >>
> >>
> >> On Thu, Mar 22, 2012 at 7:20 AM, Alfonso Quiroga <
> alfonsose...@gmail.com> wrote:
> >>> Hi, in my job we are using wicket and I've made some components like
> >>> Accordion, etc. The problem is, when the page refreshes, the accordion
> >>> state is reseted. I think I can develop this solution:
> >>>
> >>> * every time the users clicks in a accordion tab, an AJAX request is
> >>> made, to mantain the component state in the server.
> >>>
> >>> But it will be very heavy for the server, I mean, too many ajax
> >>> requests (one per click). I'm looking a NON-ajax solution.
> >>>
> >>> In the page we have links (grids with paginator, buttons, etc) Is
> >>> there a global solution that, no matter which link is clicked, it will
> >>> *always* send the component state? or maybe using cookies? thanks in
> >>> advance
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >>> For additional commands, e-mail: users-h...@wicket.apache.org
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to