2007 Apr 06 9:08 PM
I have a screen with two textedit controls on it.
The left one is for history ... just display.
The right one is for entry of new text.
When the screen pops, the cursor is positioned in the lefthand textedit control.
How do I position cursor in the righthand textedit control?
Thanks
djh
2007 Apr 06 10:01 PM
Hi,
Try this..Call the static method set_focus of the class CL_GUI_TEXTEDIT..and pass the instance..
Ex..
CALL METHOD cl_gui_textedit=>set_focus
EXPORTING
control = my_editor "instance of the class.
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
others = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope this helps..
Thanks,
Naren
I have a screen with two textedit controls on it.
The left one is for history ... just display.
The right one is for entry of new text.
When the screen pops, the cursor is positioned in the lefthand textedit control.
How do I position cursor in the righthand textedit control?
Thanks
djh
2007 Apr 06 10:01 PM
Hi,
Try this..Call the static method set_focus of the class CL_GUI_TEXTEDIT..and pass the instance..
Ex..
CALL METHOD cl_gui_textedit=>set_focus
EXPORTING
control = my_editor "instance of the class.
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
others = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope this helps..
Thanks,
Naren
2007 Apr 06 10:10 PM
2007 Apr 07 12:33 AM
Hi Rich/Naren -
I gave the 6 and the 10 the way I did because I already knew it was the set_focus method - I didn't know how to pass the control that the underlying method was looking for - that's what Naren's example showed me.
Thanks again to both of you.
You da best.
djh
2007 Apr 07 3:37 PM
N/R -
Just a note to let you know that worked as expected.
Thanks again.
djh