Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set Cursor on Text Editor CL_GUI_TEXTEDIT

Former Member
0 Likes
1,894

Hi guys,

I've created a text editor using CL_GUI_TEXTEDIT on a custom container (CL_GUI_CUSTOM_CONTAINER) and I need to set the active cursor on it.

I've tried with the method SET_FOCUS but it doesn't work.

CALL METHOD o_textedit->set_focus

EXPORTING

control = o_textedit.

Also I've tried with method GO_TO_LINE by passing the first line but it

doesn't work either. It only selects the first line but the cursor isn't

positioned on it, I mean, I need to click on the text editor to start to write.

CALL METHOD o_textedit->go_to_line

EXPORTING

line = 1.

Anyone knows how to do this?

Thanks in advance.

Hi guys,

I've created a text editor using CL_GUI_TEXTEDIT on a custom container (CL_GUI_CUSTOM_CONTAINER) and I need to set the active cursor on it.

I've tried with the method SET_FOCUS but it doesn't work.

CALL METHOD o_textedit->set_focus

EXPORTING

control = o_textedit.

Also I've tried with method GO_TO_LINE by passing the first line but it

doesn't work either. It only selects the first line but the cursor isn't

positioned on it, I mean, I need to click on the text editor to start to write.

CALL METHOD o_textedit->go_to_line

EXPORTING

line = 1.

Anyone knows how to do this?

Thanks in advance.

2 REPLIES 2
Read only

p604431
Active Participant
0 Likes
1,082

Hi,

try like this.

Data: editor2 TYPE REF TO cl_gui_textedit.

CALL METHOD CL_GUI_CONTROL=>SET_FOCUS

EXPORTING

CONTROL = editor2.

Read only

Former Member
0 Likes
1,082

Hi, thanks Gokula, works correctly, was very useful.