TXBrwColumn aEditListTxt

TXBrwColumn aEditListTxt

Postby Detlef » Mon Feb 21, 2022 4:04 pm

Hi all,
is there a way to find out the value of aEditListTxt[ nAt ] of a TXBrwColumn at the moment of selection?
I want to get the element of a parallel array.
But i'm stucked :(

Thanks for any hint
Detlef
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm

Re: TXBrwColumn aEditListTxt

Postby MGA » Mon Feb 21, 2022 5:24 pm

Hello my friend, can this help you?

oBrw:aCols[2]:nEditType := EDIT_LISTBOX
oBrw:aCols[2]:aEditListBound := {'MARINGA','LONDRINA'}
oBrw:aCols[2]:aEditListTxt := { 51, 20}

//returns the selected code , ex: 20
msginfo(oBrw:aCols[2]:value)
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1249
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: TXBrwColumn aEditListTxt

Postby Detlef » Mon Feb 21, 2022 6:16 pm

Dear MGA,
many thanks for your reply.
Unfortunately it doesn't solve my problem.

I have 2 arrays
a1 := [ "elem1", "elem2" ]
a2 := [ "white" , "blue" ]

a1 is my oBrw:aCols[2]:aEditListTxt.
If the 2nd element of a1 is clicked the column cell should become "elem2".

Now I need to know that the 2nd element was clicked.
To assign the 2nd element, value "blue" of a2 to an other column of the same row.

Therefore I think I need somthing like aEditListTxt[ nAt ].
But I don't now how to get the value of nAt.
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm

Re: TXBrwColumn aEditListTxt

Postby nageswaragunupudi » Tue Feb 22, 2022 9:12 pm

Code: Select all  Expand view
oBrw:aCols[2]:bOnChange := ;
{ |o| o:oBrw:oCol( 3 ):VarPut( a2[ AScan( a1, o:Vaue ) ] ) }
 

assuming other column number is 3.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TXBrwColumn aEditListTxt

Postby nageswaragunupudi » Tue Feb 22, 2022 9:12 pm

Code: Select all  Expand view
oBrw:aCols[2]:bOnChange := ;
{ |o| o:oBrw:oCol( 3 ):VarPut( a2[ AScan( a1, o:Vaue ) ] ) }
 

assuming other column number is 3.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TXBrwColumn aEditListTxt

Postby Detlef » Tue Feb 22, 2022 9:16 pm

My issue is solved.
I build a codeblock which does an aScan on array a1 and so I get my nAt to find the corresponding element of array a2.

Many thanks to MGA who gave me the hint about "oBrw:aCols[2]:value".
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm

Re: TXBrwColumn aEditListTxt

Postby Detlef » Tue Feb 22, 2022 9:25 pm

nageswaragunupudi wrote:
Code: Select all  Expand view
oBrw:aCols[2]:bOnChange := ;
{ |o| o:oBrw:oCol( 3 ):VarPut( a2[ AScan( a1, o:Vaue ) ] ) }
 

assuming other column number is 3.


This is much more smart.
Many thanks :D
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm

Re: TXBrwColumn aEditListTxt

Postby Detlef » Wed Feb 23, 2022 8:34 pm

nageswaragunupudi wrote:
Code: Select all  Expand view
oBrw:aCols[2]:bOnChange := ;
{ |o| o:oBrw:oCol( 3 ):VarPut( a2[ AScan( a1, o:Vaue ) ] ) }
 

assuming other column number is 3.


This works very well.
But in case the 2nd column has been edited and I want to reselect the same item from 1st column:listbox to correct the 2nd column, it doesn' work.

I see the there is no 'change event' because i selected the same value from aEditListTxt as before.
So I tried bOnPostEdit. But this doesn't work too.

Is there a way to know that a txBrwColumn:aEditListTxt was selected even when it's not different as before?
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm

Re: TXBrwColumn aEditListTxt

Postby nageswaragunupudi » Wed Mar 02, 2022 7:51 am

Is there a way to know that a txBrwColumn:aEditListTxt was selected even when it's not different as before?

No.
In the above case, logically, column 3 should not change if column 2 does not change.

1) Are you editing an array? Then there is a simpler way.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TXBrwColumn aEditListTxt

Postby Detlef » Wed Mar 02, 2022 9:05 am

Thanks for jumping in Mr. Rao.
Columns 2 and 3 are not only listboxes but also editable.
If users make a false entry in col 3 it should be possible to repeat the mechanism to click again the same value in col 2 to correct the value in col 3.
And no, it's a dbf to edit.
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm

Re: TXBrwColumn aEditListTxt

Postby nageswaragunupudi » Wed Mar 02, 2022 10:01 am

Detlef wrote:Thanks for jumping in Mr. Rao.
Columns 2 and 3 are not only listboxes but also editable.
If users make a false entry in col 3 it should be possible to repeat the mechanism to click again the same value in col 2 to correct the value in col 3.
And no, it's a dbf to edit.

You should not keep column 3 editable.
Set :nEditType := 0.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TXBrwColumn aEditListTxt

Postby Detlef » Thu Mar 03, 2022 2:23 pm

Many thanks, Mr. Rao
User avatar
Detlef
 
Posts: 207
Joined: Mon Feb 07, 2022 9:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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