Xbrowse : aBarGetlist reposition record after change

Xbrowse : aBarGetlist reposition record after change

Postby Marc Venken » Thu Mar 07, 2019 9:57 pm

Hello,

In a XBrowse, I have a (field) or object:Groep that contains data like ex. Cities
I have a index on that field in order to show them sorted by city.
I then have a array of all posible cities and I choise them from the pulldown menu.

At that point totaly normal, the position of the Xbrowse changes to the new cities.
I want to go to the next record that I have been editing before.

How do I proceed ?


Code: Select all  Expand view  RUN

   WITH OBJECT :groep
      :nEditType     := EDIT_LISTBOX
      :aEditListTxt  := aGroepen

      //:bPopUp        := { |o| ColMenu( o ) }

      :aBarGetList:= aGroepen
      //:cSortOrder = "groep"
   ENDWITH

 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : aBarGetlist reposition record after change

Postby Marc Venken » Thu Mar 07, 2019 10:34 pm

Almost there...only oBrw:goto() does not work yet

Code: Select all  Expand view  RUN

   WITH OBJECT :groep
      :nEditType     := EDIT_LISTBOX
      :aEditListTxt  := aGroepen
      :bOnChange := { |oCol, uOldVal| OnGroepChange( oBrw[1], oCol, uOldVal ) }

      //:bPopUp        := { |o| ColMenu( o ) }

      :aBarGetList:= aGroepen
      //:cSortOrder = "groep"
   ENDWITH

 


Code: Select all  Expand view  RUN

function OnGroepChange( oBrw, oCol, uOldVal )
  //xbrowser(oBrw)
  //oBrw:GoTop()
  nRecno = oBrw:BookMark
  msginfo(nRecno)
  //oBrw:GoDown()
  oBrw:Goto(nRecNo)
  oBrw:refresh()
return NIL

 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : aBarGetlist reposition record after change

Postby Marc Venken » Thu Mar 07, 2019 10:55 pm

No error, but he goes to the record afther editing.

Code: Select all  Expand view  RUN

function OnGroepChange( oBrw, oCol, uOldVal )
  nRecno = oBrw:BookMark
  msginfo(nRecno)
  oBrw:bKeyNo := oBrw:bBookMark
  oBrw:refresh()
return NIL

 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : aBarGetlist reposition record after change

Postby nageswaragunupudi » Fri Mar 08, 2019 2:39 am

nRecNo := oBrw:BookMark

oBrw:BookMark := nRecNo
Regards

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

Re: Xbrowse : aBarGetlist reposition record after change

Postby Marc Venken » Fri Mar 08, 2019 4:14 pm

I have to store the recno of the Xbrowse before I edit the record.

Xbrowse executes agetbarlist first and then it executed bonchange event as far as I can tell, because the bookmark I get is the one on the new position (afther the change)

Therefore I can not get back to the previous recno.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : aBarGetlist reposition record after change

Postby nageswaragunupudi » Sun Mar 10, 2019 11:26 pm

Try oCol:oBarGet:bGotFocus
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests