Page 1 of 1

A problem xBrowse and RELATION of 2 DBF's

Posted: Fri Nov 27, 2015 11:24 am
by ukoenig
Hello,

I noticed a problem us RELATION

DBSELECTAREA( "KUNDE" )
( "KUNDE" )->(DBSETORDER( "KUNDE1" ))
( "KUNDE" )->( ORDSETRELATION( cMonat, { || UPPER(NAME1 + NAME) }, "UPPER(NAME1 + NAME)" ) )
( "KUNDE" )->( DBGOTOP() )


After selecting a row in browser 2, the values are displayed but the position moves to row 1
selecting again the same row, everything is ok.
It happens only with the 1. selection.
Is it possible after the 1. selection to stay in the selected row ?
Removing the RELATION, there is no problem.

Image

best regards
Uwe :?:

Re: A problem xBrowse and RELATION of 2 DBF's

Posted: Fri Nov 27, 2015 4:40 pm
by ukoenig
A test with a created sample ( a combination of UNIQUE and RELATION ).
The same effect :
On 1. click in browser 2 on row 4 < Acker > ( selected in browser 1 ),
the 1. row is shown as selected ( moved )
On 2. click ( same row ) the selected row stays activated.
The effect is shown only on FIRST CLICK !!!

Selecting another name in browser 1 and going back to < Acker >
the same effect happens.

The sample includes 2 DBF's with the same names
In DBF 2, Acker is defined 4 times testing RELATION

The UNIQUE - test-button shows < Fuller > defined twice in browser 1 only once

Download :
http://www.pflegeplus.com/DOWNLOADS/Relation1.zip

Image


USE customer1 NEW SHARED ALIAS CUST1 VIA 'DBFCDX'
ORDCREATE( ,"CUST1", "UPPER(LAST)", ;
{|| UPPER(LAST) } , .F. )
ORDCREATE( ,"CUST2", "UPPER(LAST)", ;
{|| UPPER(LAST) } , .T. ) // .T. = UNIQUE
DBSETORDER("CUST1")

USE customer2 NEW SHARED ALIAS CUST2 VIA 'DBFCDX'
ORDCREATE( ,"CUST3", "UPPER(LAST)", ;
{|| UPPER(LAST) } , .F. )
DBSETORDER("CUST3")

--------

DBSELECTAREA( "CUST1" )
("CUST1")->(DBSETORDER( "CUST1" ))
("CUST1")->( ORDSETRELATION( "CUST2", { || UPPER(LAST) }, "UPPER(LAST)" ) )
("CUST1")->( DBGOTOP() )

@ 10,10 XBROWSE oBrw1 ;
COLUMNS 'Last', 'Age', 'Salary' ;
OF oDlg ;
SIZE 220, 100 PIXEL ;
PICTURES nil, '999.99 %' ;
ALIAS 'CUST1' ;
CELL LINES AUTOSORT NOBORDER FOOTERS
...
...
@ 150,10 XBROWSE oBrw2 ;
COLUMNS 'Last', 'Age', 'Salary' ;
OF oDlg ;
SIZE 220, 100 PIXEL ;
PICTURES nil, '999.99 %' ;
ALIAS 'CUST2' ;
CELL LINES AUTOSORT NOBORDER FOOTERS

best regards
Uwe :?:

Re: A problem xBrowse and RELATION of 2 DBF's

Posted: Fri Nov 27, 2015 5:54 pm
by ukoenig
added a SAY of the selected salary to show the problem.
the selected salary of row 4 is shown but doesn't stay in row 4 and moves to row 1
It happens ONLY on 1. click. The Second click is ok.

Image

best regards
Uwe :?:

Re: A problem xBrowse and RELATION of 2 DBF's

Posted: Sun Nov 29, 2015 2:56 am
by FranciscoA
I tested and saw the problem.

On the other hand, why not use scopes?

Regards.

Re: A problem xBrowse and RELATION of 2 DBF's

Posted: Sun Nov 29, 2015 11:32 am
by ukoenig
Francisco,
thank You very much.

I changed the source-part using SCOPES and it works perfect without this funny jump-effect.
I didn't think about this solution.
It was a translation of a part from Clipper-times I didn't change and I kept the logic using RELATION.

best regards
Uwe :D

Re: A problem xBrowse and RELATION of 2 DBF's

Posted: Wed Dec 02, 2015 6:40 pm
by ukoenig
A extended sample with some new tests

Download :
http://www.pflegeplus.com/DOWNLOADS/Xbrwtest3.zip


1. testing SCOPE ( browser 2 )
2. scoped browser with record MOVE-test
3. drawing boxes and lines on ALL brushes with auto-DELETE-function
4. autodelete of boxes and line ( timer )


requested from :

viewtopic.php?f=3&t=31653
viewtopic.php?f=3&t=31545

Image

best regards
Uwe :D