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

disable long text

Former Member
0 Likes
1,699

Hi experts,

Iam working on Dialog programming.

I have created long text(container) using custom control.

When display mode i want to disable this <b>container</b>.

Can any one tell me how i can i <b>disable</b>?Is it possible using Loop at screen?

Thanks

kaki

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
1,444

If you are using cl_gui_textedit you can use the set_readonly_mode method:

data: editor_obj type ref to cl_gui_textedit,

editor_cont type ref to cl_gui_custom_container.

call method editor_obj->set_readonly_mode

exporting readonly_mode = cl_gui_textedit=>true.

9 REPLIES 9
Read only

Former Member
0 Likes
1,444

Hai,

No there is no screen grouping in custom container, but you can enable & disable a control using the container methods (<b>SET_ENABLE</b>) of CL_GUI_CUSTOM_CONTAINER. Try it.

Read only

sushant_singh
Participant
0 Likes
1,444

to disable the long text . use

protect_lines method of class cl_gui_textedit.

Read only

0 Likes
1,444

hi,

use class CL_GUI_TEXTEDIT -

method: SET_ENABLE_EDITING_PROTECTED

Andreas

Read only

0 Likes
1,444

Hi experts,

My code is like this..


DATA: txt     TYPE REF TO cl_gui_textedit.
DATA: from_idx TYPE i.
DATA: to_idx TYPE i.

    CALL METHOD txt->protect_lines
      EXPORTING
        from_line = from_idx
        to_line   = to_idx.
        protect_mode                  = txt->true
        ENABLE_EDITING_PROTECTED_text = txt->true.

why it is not working?

kaki

Read only

0 Likes
1,444

Hi Neil Woodruff ,

It is working

Thanks a lot.Full points alloted..

cheers

kaki

Read only

0 Likes
1,444

I would use the other method but this one should be ok too...

1. what values are you passing in the parameters

2. have you 'created' the txt object and it's parent container? ie.

for these object declarations:

data: editor_obj type ref to cl_gui_textedit,

editor_cont type ref to cl_gui_custom_container.

I had to:

create object editor_cont exporting container_name = 'C_TEXT'.

create object editor_obj exporting parent = editor_cont

wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position

wordwrap_position = 79

wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

-


First answer accepted:

Ignore the above then! Thanks for the points.

Read only

0 Likes
1,444

Hi Neil,

What is the best way to save the text using STXH table with my container(txt).

thanks

kaki

Read only

former_member186741
Active Contributor
0 Likes
1,445

If you are using cl_gui_textedit you can use the set_readonly_mode method:

data: editor_obj type ref to cl_gui_textedit,

editor_cont type ref to cl_gui_custom_container.

call method editor_obj->set_readonly_mode

exporting readonly_mode = cl_gui_textedit=>true.

Read only

sushant_singh
Participant
0 Likes
1,444

while creating object of the editor

pass wordwrap_mode = 2

wordwrap_position = 70

70 is the no. of characters in a single line of editor.

now use method protect_lines.

now ur code will work.