Hot Topic (More than 10 Replies) Form Navigation (Read 1636 times)
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Form Navigation
Mar 13th, 2009 at 8:32pm
Print Post Print Post  
This is a new behavior and it appears may be related to our upgrade to V2.1.

One of our applications (which has been in use for about a year) is made up of a number of tab pages.  At the bottom of the assortment of tab pages is an element that contains a menu made up of six static push buttons that we use for various print, save and exit options.  When we first open the database the first tab page presents itself as always but the focus is on the first of the six push buttons.  To actually arrive at the first field in the form the user is obliged to tab through all six of the push buttons before arriving at the first form field at the seventh key stroke...

I've looked at the navigation order and such and everything is as it should be by all appearances.

As always...any and all help is very much appreciated.

Cliff
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Form Navigation
Reply #1 - Mar 14th, 2009 at 7:48pm
Print Post Print Post  
I am seeing the same thing here. The problem is that you don't have any other navigable elements before the TabPage group, so Sesame seems to prefer to start with focus on a command button rather than a TabPage, even though the navigation order may have the TabPage at the top of the list.

This is not perfect, but a workaround would be to put an unbound text field in the top left corner of the form. Make it 1 by 1 pixels in size, to keep it almost totally out of sight. This will allow Sesame to begin with focus on that element when the form first opens. Then, at least, you can get to the first element on the TabPage by pressing the tab key just twice.

Unfortunately, calling ThrowFocus() or GotoTabPage() from either the On Form Entry or On Retrieve Spec Open events doesn't seem to work in this case. (Though, ThrowFocus() will send focus to an element on a TabPage if it is called from another element's entry or exit event - just not immediately upon opening the form.)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Form Navigation
Reply #2 - Mar 14th, 2009 at 11:16pm
Print Post Print Post  
Carl's suggestion is correct, but rather than making an element 1x1, I would make it larger so it will be visible to me in Design mode.  Same height as "normal" elements, with the width narrowed to square with the height.

Make it with no border and the background/fill color the same color as the form. 
Style should be flat, and have a label, but put in code on the form to make the label invisible.

Now, when you are in Design Mode, the label will be visible and remind you that there is an invisible "set focus" element on the tab page.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Form Navigation
Reply #3 - Mar 16th, 2009 at 2:53pm
Print Post Print Post  
Hi Carl and Bob...thank you very much.  Much appreciated!

I tried your suggestions and Sesame does first see my new "focus" field first, however, when exiting that field Sesame then points to the first command button obliging tabs through them all before we get to the first element of the the first tab page.

Using ThrowFocus() and GOTO from my "focus field" have no affect on the behavior at all.

I am likely missing a fine point somewhere and do thank you for your help.

Cliff

  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Form Navigation
Reply #4 - Mar 17th, 2009 at 2:31am
Print Post Print Post  
Cliff,

Check the navigation order to see if the TabPage group is 2nd in line (just after the new element). If that doesn't help, you should be able to place a ThrowFocus() in the new element's On Element Exit event.
  


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



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Form Navigation
Reply #5 - Mar 17th, 2009 at 2:14pm
Print Post Print Post  
In "Set Navigation Order"; I have 13 "element groups" beginning with the form element group (POLICY) plus 12 tab pages.

In the form element group my new "FOCUS ELEMENT" shows at the top of the list followed by the first (of the six) button (SEARCH_UPDATE) and so on...

I don't know if this is helpful but the form element contains only the "focus element" and the six buttons I mentioned earlier.

I trided using ThrowFocus on exit to the first field of the first tab page which is "POLICY_NO" i.e., ThrowFocus(POLICY_NO) after your first direction to me and it appears to be ignored...

However, I just double checked this and it seems we are half way there.  If I open the form in "Add Data" mode the ThrowFocus does its job, however, if I open the form in "Search/Update" mode it does not.

I do appreciate you slogging through this tedium with me...

Again...thanks...
  
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Form Navigation
Reply #6 - Mar 17th, 2009 at 5:40pm
Print Post Print Post  
have you included     If @Mode() = 1           to your code ?

so .... ,

       If (@Mode() = 0) or (@Mode() = 1)      // if mode is "add" or "update"
                {
                    your programming here
                }


// states "If the mode is "add" or "update" then execute the following code"

I hope I'm not steering you wrong here  Undecided
  

Larry
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Form Navigation
Reply #7 - Mar 18th, 2009 at 4:04am
Print Post Print Post  
Cliff wrote on Mar 17th, 2009 at 2:14pm:
...it seems we are half way there.  If I open the form in "Add Data" mode the ThrowFocus does its job, however, if I open the form in "Search/Update" mode it does not.


When you say "Search/Update", do you mean at the Retrieve Specs (Search)?

Code in the On Element Exit (or On Element Entry)event will not execute at the Retrieve Spec screen. But, you should be getting the same results in Update mode as you are getting in Add mode, unless you are using a conditional statement that is preventing it (as lksseven pointed out).




BTW, as a side note, command buttons DO execute code in their On Element Entry event.
  


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



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Form Navigation
Reply #8 - Mar 27th, 2009 at 3:05pm
Print Post Print Post  
Thank you to Carl and Iksseven...

By Search/Update I am refering to the Retrieve Spec search.

To eliminate variables I removed all possible cases of conditional programming to test and applied several different iterations of the various things discussed including the @Mode() suggestion to no avail.

As before everything works well in "Add" mode but things go "pear shaped" when in "Update"...

I am thinking that my only option will be to replicate my various command buttons on each tab page...the up side is that would certainly solve the problem...the down side is that I have eleven tab pages...yikes!!   Shocked

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Form Navigation
Reply #9 - Mar 27th, 2009 at 5:29pm
Print Post Print Post  
The only elements that should go on a tab page are those that are specific to that tab page. If an element is useful on every tab page, it should appear on the form itself, and thereby be available to every tab page.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Form Navigation
Reply #10 - Mar 27th, 2009 at 8:25pm
Print Post Print Post  
Agreed...however, the focus went awry after the upgrade...see above...
Thanks...
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Form Navigation
Reply #11 - Mar 27th, 2009 at 10:28pm
Print Post Print Post  
I'm trying to tell you that your solution - putting the buttons on each of the tab pages, would lead to more problems, without regard for any changes that may have happened with the upgrade. I would try to find a different solution.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Form Navigation
Reply #12 - Apr 14th, 2009 at 7:04pm
Print Post Print Post  
Thank you...
  
Back to top
 
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Form Navigation
Reply #13 - Apr 17th, 2009 at 5:33pm
Print Post Print Post  
I thought I'd revisit this issue having some hours to do so.  What I have found is that there was some issue with the group / user security settings.  I removed all the security settings on the application and the "focus" issue was no longer an issue even without using additional code, i.e, "ThrowFocus()", etc.  I recreated security and all seems well.

So am "feeding back" to let any know what I found...

Thanks again...
  
Back to top
 
IP Logged