myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: Redisplay a JSF site after submit with the scrolling state previously used?
Date Mon, 28 Nov 2005 15:52:14 GMT
It's not a component -- it's just a configuration option:

    <context-param>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
        <description>
            If true, a javascript function will be rendered that is
able to restore the
            former vertical scroll on every request. Convenient
feature if you have pages
            with long lists and you do not want the browser page to
always jump to the top
            if you trigger a link or button action that stays on the same page.
            Default: "false"
        </description>
    </context-param>

Your best bet is to do a view source and look at function
getScrolling() and how it's called from each UICommand.

On 11/28/05, Matthias Kahlau <mkahlau@web.de> wrote:
> Hi!
>
>
> Is there a separate component which supports autoscrolling to the component
> which submitted the form? I can't find one in the Tomahawk TLD Doc.
>
>
> Regards,
> Matthias
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: users-return-12945-mkahlau=web.de@myfaces.apache.org
> > [mailto:users-return-12945-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > von Mike Kienenberger
> > Gesendet: Montag, 28. November 2005 16:26
> > An: MyFaces Discussion
> > Betreff: Re: Redisplay a JSF site after submit with the scrolling state
> > previously used?
> >
> >
> > Matthias,
> >
> > There's already javascript support in MyFaces for doing "autoscrolling."
> >
> > Currently, it always scrolls back to the UICommand component that
> > submitted the form.
> >
> > I've tried to write my own javascript that scrolls it to any arbitrary
> > component on the page, but I don't really know javascript.
> >
> > It'd be great if you could figure out how to take advantage of the
> > existing autoscroll javascript to make it work with arbitrary
> > components.   Maybe we could then figure out a tag to set the
> > autoscroller -- <f:setAutoScrollToHere> or something like that :)
> >
> > On 11/26/05, Matthias Kahlau <mkahlau@web.de> wrote:
> > > Hi!
> > >
> > >
> > > I use a method for valueChangeListeners of selectOneMenu and other multi
> > > choice tags. In the valueChangeListeners method, I can set the state of
> > > boolean variables, which are used in the JSF site in attributes like
> > > disabled and rendered of some tags.
> > >
> > > A valueChangeListener method is invoked when the value of the
> > related tag
> > > changes, which causes a submit of the form. The problem is,
> > that some tags
> > > are below the fold, and when the form is submitted because of a
> > value change
> > > and then redisplayed again, the site is scrolled to top, and
> > the user has to
> > > scroll down to the component, where he changed the value.
> > >
> > > Does somebody know if it is possible to redisplay the site with the
> > > scrolling state previoulsy used? (I know that I could
> > alternatively set the
> > > disabled and rendered states of the tags by using client-side
> > JavaScript,
> > > without submitting the form and changing the scrolling state, but that's
> > > more work and doesn't use the server-side facilities).
> > >
> > >
> > > Regards,
> > > Matthias
> > >
> > >
>
>

Mime
View raw message