Retrieve and set focus

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Retrieve and set focus

#1 Post by skiman »

Hi,

I have the following:
Customer screen with dcsay ... GET ...
2 buttons with prev/next.

When I'm in edit mode in this screen, and my cursor is on a field, if want that the focus remains on that field after clicking the buttons for skipping.

If the cursor is on address, if want it returns on address after skipping, if the focus is on phone number, i want it back on phone numer after skipping, ...

I tried the following:

Code: Select all

   @ nRow+nBottom,5 dcpushbuttonXP notabstop BITMAP ABO_PREV1N ALIGN 4 OFFSET 3 CONFIG oConfig SIZE 10,2 CAPTION 'F1' ;
        ACCELKEY xbeK_F1 ;
        ACTION {|o| ... if(valtype(oOldfocus)="O",dc_setappfocus(oOldFocus),),dc_getrefresh(getlist) } ;
	GOTFOCUS {|| oOldFocus:=dc_setappfocus() }
The following error appears:

Code: Select all

oError:args         :
          -> VALTYPE: U VALUE: NIL
oError:canDefault   : N
oError:canRetry     : N
oError:canSubstitute: Y
oError:cargo        : NIL
oError:description  : Receiver of message is not an object.
oError:filename     : 
oError:genCode      :         38
oError:operation    : setParent
oError:osCode       :          0 
oError:severity     :          2
oError:subCode      :       2266
oError:subSystem    : BASE
oError:thread       :          3
oError:tries        :          0
Any suggestions?
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Retrieve and set focus

#2 Post by Cliff Wiernik »

This is what I use if I am in edit mode and click a popup button for some reason and want to return to the last edit focus.

Code: Select all

  IF valtype(DC_EditControlLastFocus(aMainGetList))=='O'
    SetAppFocus(DC_EditControlLastFocus(aMainGetList))
  ENDIF

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

Re: Retrieve and set focus

#3 Post by skiman »

Hi Cliff,

Thanks for the tip. Is working as expected. I wasn't aware of that function.
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Retrieve and set focus

#4 Post by Cliff Wiernik »

Roger pointed it out to me quite a while ago.

Post Reply