Normal Topic ThrowFocus and Long Forms (Read 748 times)
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
ThrowFocus and Long Forms
Mar 9th, 2008 at 2:22am
Print Post Print Post  
I have a form that extends beyond the height of the screen.  When I'm working in the bottom area, and click a button which saves the form via FormCommit(""), the screen always scrolls to the top of the form.  This occurs even if I use ThrowFocus() to set the focus to a Layout Element at the bottom of the form.  What do I need to do to either keep the form from scrolling up or to make it scroll down?

(v2.0.5)
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: ThrowFocus and Long Forms
Reply #1 - Mar 9th, 2008 at 4:46am
Print Post Print Post  
Interesting. I tested this, and I stay at the bottom of the form, leaving me with focus on the command button that I just clicked, which contains just FormCommit("").
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
Re: ThrowFocus and Long Forms
Reply #2 - Mar 9th, 2008 at 10:31pm
Print Post Print Post  
Quote:
Interesting. I tested this, and I stay at the bottom of the form, leaving me with focus on the command button that I just clicked, which contains just FormCommit("").

Hmmm....well I probably oversimplified my situation.  I'm committing both the main form and the subform, plus doing other stuff.  I'll have to pull it apart and see what makes it fail to return to the bottom of the page.
  
Back to top
 
IP Logged
 
MP
Full Member
***
Offline



Posts: 104
Joined: Sep 3rd, 2007
Re: ThrowFocus and Long Forms
Reply #3 - Mar 9th, 2008 at 10:56pm
Print Post Print Post  
OK, I created a very specific test case.  I created a simple app with an Invoice form and a LineItems sub-form.  I put the sub-form and a command button below the page break.  The commit button contains the following code:
Code
Select All
FormCommit( "LineItems" )
FormCommit( "" )

ThrowFocus( Commit ) 


When I click commit, the page scrolls to the top.  If I comment out the FormCommit("") statement, it doesn't scroll.  I'd be happy to provide the sample code.

(Cross-posted to Sesame Online Support)
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: ThrowFocus and Long Forms
Reply #4 - Mar 10th, 2008 at 7:27pm
Print Post Print Post  
I had nothing but FormCommit("") in the button event. You shouldn't need to ThrowFocus to the Commit button itself.

Don't have time right now, but I may play with this a bit more later.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged