Valid not getting evaluated after button click

Valid not getting evaluated after button click

Postby anserkk » Wed Oct 15, 2008 11:10 am

Hi friends,

I don't know where I have went wrong.

I am having a very strange problem. Valid is getting evaluated only once. After I click the button,the valid's are not getting triggered

I have 3 gets in the Dialog with valid statement !empty(cVar). Initially it works fine. But after I click the Save button, if I try to make the get's empty, the valid is not getting fired.

I am herewith pasting an example code

Pls note: The problem occurs only after clicking the save button

Code: Select all  Expand view
#include "FiveWin.ch"
*-----------------------------------------*
Function Main()
*-----------------------------------------*
Local oDlg, oBtnSave, oBtnCancel
Local cAcName:=spac(30), cAddr1:=space(50), cAddr2:=space(50)
Local aOGets:={nil,nil,nil}

DEFINE DIALOG oDlg TITLE "Add New Account Heads" from 1,1 to 19,80

@01  ,04 say "A/c Name *" OF oDlg RIGHT SIZE 45, 12
@02  ,04 say "Address Line 1 " OF oDlg RIGHT SIZE 45, 12
@03  ,04 say "Address Line 2 " OF oDlg RIGHT SIZE 45, 12

@01.2,10 get aOGets[1] VAR cAcName OF oDlg  valid !empty(cAcName)
aOGets[1]:cToolTip := "Please Type in the Account Name"
@02.3,10 get aOGets[2] VAR cAddr1 of oDlg Valid !empty(cAddr1)
@03.4,10 get aOGets[3] VAR cAddr2 of oDlg Valid !empty(cAddr2)

@05,02 BUTTON oBtnSave   PROMPT "Save" SIZE 50,15 OF oDlg
@05,15 BUTTON oBtnCancel PROMPT "Cancel" SIZE 50,15 OF oDlg CANCEL ACTION oDlg:End()

ACTIVATE DIALOG oDlg ;
   VALID ( oDlg:=NIL,;
           .T.)
Return NIL


Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby fgondi » Wed Oct 15, 2008 11:19 am

Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Postby anserkk » Wed Oct 15, 2008 11:52 am

Hi,

Thank you for the link

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby James Bott » Wed Oct 15, 2008 4:31 pm

Anser,

I must mention that whenever you require that a field not be empty, you may well end up with users entering meaningless data, just anything, so they can complete the screen. I would rather have the field left blank than have bad data entered into it.

Optionally, you can keep track of records that are missing data so they can be found and fixed at a later time. Or, you can just scan the database looking for fields that are blank that need to be filled out.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby anserkk » Thu Oct 16, 2008 5:00 am

Dear Mr.James,

Very much true
whenever you require that a field not be empty, you may well end up with users entering meaningless data, just anything, so they can complete the screen


I have read your post's on this topic and have found that changing the back colour while entering erroneous data to attract the app. user's attention very impressive

Thankyou very much for your valid views regarding the interface designing part of application.

I am in a very preliminary stage and I am trying different available options and want to choose the most appropriate one to suit the requirement of my environment here.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby driessen » Thu Oct 16, 2008 2:27 pm

Anser,

You can also have a look at this topic http://forums.fivetechsoft.com/viewtopic.php?t=12972 where I talk about the same problem.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby anserkk » Fri Oct 17, 2008 5:19 am

Thankyou Michel for the link

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 63 guests