If you've enabled the AUTOSCROLL parameter in your web.xml file, you
should be seeing javascript generated like the following for each
command-link/command-button.

onclick="clear__5FtagId1_5F2();document.forms['_tagId1_2'].elements['autoScroll'].value=getScrolling();document.forms['_tagId1_2'].elements['_tagId1_2:_link_hidden_'].value='_tagId1_2:showAttachmentStatusableWorkList';if(document.forms['_tagId1_2'].onsubmit){var
result=document.forms['_tagId1_2'].onsubmit();  if( (typeof result ==
'undefined') || result )
{document.forms['_tagId1_2'].submit();}}else{document.forms['_tagId1_2'].submit();}return
false;"

The javascript below sets the current element (generally a
command-link) as the location to scroll to when the page reloads.

document.forms['yourFormId'].elements['autoScroll'].value=getScrolling();

Unfortunately, I haven't figured out how to make it scroll to any
arbitrary component on the page, but I'd think just enabling the
parameter should make it scroll back to your sorting link.

    <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>


On 12/19/05, Mike Duffy <[EMAIL PROTECTED]> wrote:
> I have implemented a sortable table with the <t:dataTable/> tag.  It's very 
> cool.  Thx to those
> who worked on this.
>
> I am not a JavaScript guru, so I am having some trouble with something that 
> should be very basic:
> My sortable table is near the bottom of my page.  After the page refreshes. 
> I'd like to
> automatically scroll back to the table.
>
> Any suggestions?
>
> Mike
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Reply via email to