> rememberScrolling is called in the onSubmit event of the form:
> <h:form id="docform" onsubmit="rememberScrolling();return true;">

Take care returning "true" in javascript events like this, as it will skip the rest of the JSF lifecycle. Be sure this is actually what you want.

Regards,

Jeff Bischoff
Kenneth L Kurz & Assoc, Inc.

Michael Heinen wrote:
Hi,

The setFocus method is called in the body onload event.

rememberScrolling is called in the onSubmit event of the form:
<h:form id="docform" onsubmit="rememberScrolling();return true;">


Do you have a similar setup with scrollable div tags?
General autoscrolling can be enabled in web.xml:
    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
    <param-value>false</param-value>
But this autoscrolling works only for the window scrollbars.

Hope this helps
Michael

PS: I sent this also to the list


-----Original Message-----
From: Satish Kumar Mummadi [mailto:[EMAIL PROTECTED] Sent: Montag, 12. Juni 2006 21:24
To: Michael Heinen
Subject: JSF scroll issue

Hi,

I came across your posting on the Internet for the code snippet to store
& retrieve a scrollbar previous scroll position...
http://mail-archives.apache.org/mod_mbox/myfaces-users/200603.mbox/%3CFE
[EMAIL PROTECTED]
E

I followed your note and created a Bean variable (HtmlInputHidden
docDivYScroller)

and I also added this on the JSF page
<h:inputHidden id="yscroller" binding="#{MyBean.docDivYScroller}"/>
<script type="text/javascript">
var yscroll = document.getElementById('docform:yscroller');
var docsdiv = document.getElementById('docsdiv');
function setFocus(){
  if (docsdiv!=null) {
     docsdiv.scrollTop=yscroll.value;
  }
}
function rememberScrolling() {
   if (docsdiv!=null) {
      yscroll.value = docsdiv.scrollTop;
   }
}

My question is how do I call these javascript functions? where do I need
to call them??

can you please help me with this

Thanks
Satish

</script>








Reply via email to