Normal Topic throwfocus @msgbox radiobutton group (Read 703 times)
Frederick_JH
Junior Member
**
Offline


Open Sesame . . . the
magic portal awaits!

Posts: 52
Joined: Jan 26th, 2004
throwfocus @msgbox radiobutton group
Feb 22nd, 2006 at 10:03pm
Print Post Print Post  
Hi all!  
I have run into a interesting situation. I have use this code before to popup a box to tell the user after a few tries that they need to enter a value and send them back to the current field. I have stayed away from goto command after what  I have read here on the fourm.  

This code below work fine on a normal text box but when I use it on a field  with three radio buttons it goes through it three @msg and returns to the current field (language) however when the user clicks on the ok on the @msgbox it goes not to the current field but to the first field on the form. Anyone know why it does this and how to fix it?  Thanks!  Frederick  

vEntryErrorCount is a static variable called in the Global Code for the form.

Code
Select All
// Check to make sure that this element is not blank.
if @isblank(ThisElement) then vEntryErrorCount = vEntryErrorCount + 1 //Error variable counts a few times before getting in the users face
if @isblank(ThisElement) and (vEntryErrorCount > 3) then {
@MsgBox("You seem to be having some trouble here.","You must enter a language.","Without it this record is useless!")
}
if @isblank(ThisElement) then {
@msg("WARNING!  THIS FIELD NEEDS A LANGUAGE")
@Play("Beep")
throwfocus(ThisElement)
}

//If all is well and we are moving on set the error counter variable to 0
if (not @isblank(ThisElement)) then {
vEntryErrorCount = 0
Cnext
}
 

« Last Edit: Feb 23rd, 2006 at 5:00pm by Frederick_JH »  

Frederick Henderson*Radio HRGS*Roatan*Bay Islands*Honduras
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: throwfocus @msgbox
Reply #1 - Feb 22nd, 2006 at 10:21pm
Print Post Print Post  
Hello Fredrick,

What version of Sesame are you running?

Try creating a simple application that has a Radio Button Group and another element. Put your code in there and see if the same thing happens.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Frederick_JH
Junior Member
**
Offline


Open Sesame . . . the
magic portal awaits!

Posts: 52
Joined: Jan 26th, 2004
Re: throwfocus @msgbox radiobutton group
Reply #2 - Feb 23rd, 2006 at 5:00pm
Print Post Print Post  
I am using Version 1.1.3 for Linux for newer linuxes.

I created a new database and added four elements:

test  textbox
test2 radio button group
test3 textbox
test4 textbox

I added three radio buttons to test2.

I dropped the code above in all four fields on element  exit programming.
Global code to declare the static variable:

stat vEntryErrorCount = 0  // Variable to be used to count Entry try errors

The results are exactly the same. I can tab through and get the error @msg and @msgbox on the text box fields but the radio button group after pressing enter to answer OK to the @msgbox it sends me back to the first field on the form.

Thanks again for any help!

  

Frederick Henderson*Radio HRGS*Roatan*Bay Islands*Honduras
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: throwfocus @msgbox radiobutton group
Reply #3 - Feb 23rd, 2006 at 10:10pm
Print Post Print Post  
Hello Fredrick,

I now see what you are seeing. Only happens on Linux. I will write it up and pass it along to development.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Frederick_JH
Junior Member
**
Offline


Open Sesame . . . the
magic portal awaits!

Posts: 52
Joined: Jan 26th, 2004
Re: throwfocus @msgbox radiobutton group
Reply #4 - Feb 23rd, 2006 at 10:38pm
Print Post Print Post  
Thanks  Ray!

Good to know that I am not programing crazy things  Roll Eyes and that it happens to you too.

  

Frederick Henderson*Radio HRGS*Roatan*Bay Islands*Honduras
Back to top
 
IP Logged