Editing and Updating a Value in DCBROWSECOL

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Editing and Updating a Value in DCBROWSECOL

#1 Post by GeneB »

I am trying to edit a value in DCBROWSECOL with a function, MyFunction, called by VALID.
When MyFunction closes, I need to pass the value back to DCBROWSECOL and have the screen display the new value in the cell.

I have tried, among other things, the code below.
The result is that the value in the cell for Element 2 is originally typed "ABC 1234", MyFunction allows the user to select "ABC 1234 GOLD", the second value flashes in the cell after closing MyFunction and is quickly replaced with the original value "ABC 1234". The number of choices is over 200,000 so is too big for a user to select from without narrowing the choices. MyFunction narrows them based on what is originally typed in the cell, so if I use DCCOMBOBOX the array of choices would have to built and passed to DCCOMBOBOX after the data is typed into the cell.

Could someone kindly show me how to do this?
Thanks in advance.
GeneB

Code: Select all

   @ 1,1 DCBROWSE oThings  DATA aThings  SIZE 50,8 ;
      EDIT xbeBRW_ItemSelected MODE DCGUI_BROWSE_EDITACROSSDOWN

      DCBROWSECOL ELEMENT 1  HEADER "Qty"   PARENT oThings WIDTH 3  EDITOR 'QtyEditor'
         @ nil,nil DCGET xNil PICT "999" ;
         GETID 'QtyEditor'

      DCBROWSECOL ELEMENT 2  HEADER "Item"  PARENT oThings WIDTH 20   EDITOR 'ItemEditor'
         @ nil,nil DCGET xNil PICT "@!" ;
         GETID 'ItemEditor' ;
         VALID {|| xNil := MyFunction(xNil) ;
                 , DC_GetRefresh(getlist) ;
                 , .T. }

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: Editing and Updating a Value in DCBROWSECOL

#2 Post by GeneB »

DATALINK or VarGet() ?
Use a CRT screen?

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Editing and Updating a Value in DCBROWSECOL

#3 Post by skiman »

Hi,

This is how I'm doing it.

Code: Select all

@ nil , nil DCGET xNil GETID 'EDITREK' FONT '9.arial' PICTURE '@K9999999' ;
       VALID {|oGet,cVar,o| cVar:=oGet:Get:varget(),;
               cVar := myfunction(cVar) ,;
               oGet:get:varput(cVar),oGet:get:updatebuffer(),;
               oBrowse:Refreshall(),setappfocus(oBrowse),.T.} 
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Editing and Updating a Value in DCBROWSECOL

#4 Post by rdonnay »

Can you give me a sample that I can compile and run?
The eXpress train is coming - and it has more cars.

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: Editing and Updating a Value in DCBROWSECOL

#5 Post by GeneB »

Thanks, Chris, this works perfectly. I learned something.
Thank you for your time.
-=# GeneB

Post Reply