How to keep a valid from firing when you select a new radio

Post Reply
User avatar
Rick Lipkin
Posts: 2674
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

How to keep a valid from firing when you select a new radio

Post by Rick Lipkin »

To All

I have an interesting problem.... I have 3 radio buttons with corresponding entry fields .. each of the fields have a when and valid clause ..
Image
when I move the radio button from 1 to 2 the valid fires from the first radio button ... how do I keep the valid from firing when I move the cursor to a different radio button .. I only want the valid to fire when the cursor is in the entry field and the <enter> button is hit .. like an ON ENTER clause ??

Code: Select all | Expand


 REDEFINE RADIO oRAD var nRAD ID 185, 187, 189, 191 of oWork ;
       ON CHANGE ( _ChkRadio( nRad,oRad,oL,oV,oD,@xL,@xV,@xD  ))

   REDEFINE GET oL var xL ID 186 of oWork PICTURE "@!";
   when  nRAD = 1  ;
   Valid _VehGet( oRsWork,cLicense,oLicense,@cVehEid,oVNUMBER,@cVNUMBER,oMAKE,@cMAKE,oTYPE,@cTYPE,oYEAR,;
                     @cYEAR,oSERIALNUMB,@cSERIALNUMB,;
                     oPROG,@cPROG,oEQUIP,@cEQUIP,@cProgEid,@cEquipEid,@cDepEid,@cDeputy,@cMotorPool,@cPoolID, "BUTTON",;
                     @cPropMaint,oPropMaint,nRad,@xL,@xV,@xD,oL,oV,oD) UPDATE


//----------------------------------
Static Func _ChkRadio( nRad,oRad,oL,oV,oD,xL,xV,xD )


Do Case
Case nRad = 1
   xL := space(8)
   xV := space(5)
   xD := space(7)

   oL:ReFresh()
   oV:ReFresh()
   oD:ReFresh()

   oL:Enable()
   oV:Disable()
   oD:Disable()

   SysReFresh()
   oL:SetFocus()
   Return(nil)

Case nRad = 2
   xL := space(8)
   xV := space(5)
   xD := space(7)

   oL:ReFresh()
   oV:ReFresh()
   oD:ReFresh()

   oL:Disable()
   oV:Enable()
   oD:Disable()

   SysReFresh()
   oV:SetFocus()
   Return(nil)

Case nRad = 3
   xL := space(8)
   xV := space(5)
   xD := space(7)

   oL:ReFresh()
   oV:ReFresh()
   oD:ReFresh()

   oL:Disable()
   oV:Disable()
   oD:Enable()

   SysReFresh()
   oD:SetFocus()
   Return(nil)

ENdCase

Return(nil)
 
User avatar
Enrico Maria Giordano
Posts: 8767
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: How to keep a valid from firing when you select a new radio

Post by Enrico Maria Giordano »

Rick,

you can add

nRad = 1 .AND. ...
nRad = 2 .AND. ...

and so on to the VALID of the corrispondent GET.

EMG
User avatar
Rick Lipkin
Posts: 2674
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: How to keep a valid from firing when you select a new radio

Post by Rick Lipkin »

Enrico

I thought of that .. if you code When ( nRad = 1 .and. cVar = " ") .. you can not navigate into the field .. what I did as a work around is to take the focus off the Get so I rem'd out ( oL:Setfocus() ) so the Get field is not in focus .. that allowed me to be able to traverse the radio buttons without the valids firing .. However, I wanted to automatically set the get in focus during the ON radio change .. to keep the user from hitting TAB .. but once the get has focus .. there seems no way to traverse the radio buttons without the valid firing on nRad change.

I was hoping for a different solution .. but for now I have a work-around

Thanks
Rick Lipkin
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: How to keep a valid from firing when you select a new radio

Post by Antonio Linares »

Rick,

Maybe the solution is to use just the VALID of the dialog only
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply