FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error with bEditValid - xBrowse
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Error with bEditValid - xBrowse
Posted: Thu Mar 25, 2010 11:02 AM
Antonio ,
In this example below bEditVAlid is executed 2 times
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oDlg, oBrw
   
   Local aDati := {{0,0,0},{0,0,0},{0,0,0} }
  
   DEFINE DIALOG oDlg RESOURCE "Test"
   REDEFINE XBROWSE oBrw ID 10 OF oDlg ARRAY aDati AUTOCOLS CELL LINES 
   
   WITH OBJECT oBrw:aCols[1]
      :nEditType     := EDIT_GET
      :bEditValid    := { | oGet, oCol | MSGINFO("Hello") ,.T. }
   END
   ACTIVATE DIALOG oDlg

return nil

The RC File is
Code (fw): Select all Collapse
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

TEST DIALOG DISCARDABLE 68, 43, 336, 213
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
  CONTROL "", 10, "TXBrowse", WS_TABSTOP|0x00a00000, 0, 0, 168, 84
}


But with this code it is executed correctly 1 time

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oDlg, oBrw
   
   Local aDati := {{0,0,0},{0,0,0},{0,0,0} }
   
   DEFINE WINDOW oDlg

   @ 10,10 XBROWSE oBrw OF oDlg ARRAY aDati AUTOCOLS CELL LINES 
   WITH OBJECT oBrw:aCols[1]
      :nEditType     := EDIT_GET
      :bEditValid    := { | oGet, oCol | MSGINFO("Hello") ,.T. }
   END
   
   oBrw:CreateFromCode()
   oDlg:oClient   := oBrw

 ACTIVATE WINDOW oDlg
   

return nil


Regards Maurizo
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Error with bEditValid - xBrowse
Posted: Sun Mar 28, 2010 11:25 AM

Hello ,

Is there a solution to this problem?

Regards Maurizio

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Error with bEditValid - xBrowse
Posted: Sun Mar 28, 2010 11:33 AM

Hello Maurizio..

try with this...

viewtopic.php?f=6t=15953p=82608hilit=bvalid#p82608

&&&

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error with bEditValid - xBrowse
Posted: Mon Mar 29, 2010 02:03 AM
Please modify xbrowse.prg ( version 10.2 ) like this:
line no:9781-9783
Original code:
Code (fw): Select all Collapse
   if ::bEditValid != nil
      ::oEditGet:bValid := { | oGet, lRet | oGet:lValidating := .T., lRet := Eval( ::bEditValid, oGet, Self ), oGet:lValidating := .F., If( ! lRet, oGet:SetFocus(),), lRet }
   endif

Modify the assignment to ::bValid as :-
Code (fw): Select all Collapse
      ::oEditGet:bValid := { | oGet, lRet | oGet:lValidating := .T., lRet := Eval( ::bEditValid, oGet, Self ), ;
               oGet:lValidating := .F., If( ! lRet, oGet:SetFocus(), oGet:bValid := nil ), lRet }

With this modification, EditValid is executed only once.
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Error with bEditValid - xBrowse
Posted: Mon Mar 29, 2010 06:32 AM

Thank Nage

now works correctly ,
Antonio is it possible include in the original version ?

Maurizio

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error with bEditValid - xBrowse
Posted: Mon Mar 29, 2010 10:10 AM

Maurizio,

Yes, we are going to include it :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion