Application Development 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: 

How can i change Text Editor Display Mode ?

Former Member
0 Kudos
1,540

I wanna change text editör display mode When i clicked the button display mode is change

How Can i do this?


I'm using this code in module output but this time display mode is'nt change when clicked the button.


Data : gv_tbox scr type i.

This value is get value for the button stuation. it values 1 or 0.





module crt_tedit output.


create text_editor...

....


CALL METHOD l_editor->set_readonly_mode

EXPORTING

   readonly_mode gv_tbox_scr.


endmodule.


Note When i write this code in module input it doesnt' work .


I think i have to refresh the text editor ?


How Can i do this ?

Thanks

1 ACCEPTED SOLUTION

former_member202818
Active Contributor
0 Kudos
271

Hi Burak,

Ensure that the statement 'CREATE OBJECT o_text_editor .....' is not getting executed each time..

do this ..

if o_text_editor is initial.

CREATE OBJECT o_text_editor .....

endif.

Also verify the value of gv_tbox_scr.

4 REPLIES 4

rosenberg_eitan
Active Contributor
0 Kudos
271

See

Found it by using google Search operators :   site:scn.sap.com  change Text Editor Display Mode

Regards.

former_member202818
Active Contributor
0 Kudos
272

Hi Burak,

Ensure that the statement 'CREATE OBJECT o_text_editor .....' is not getting executed each time..

do this ..

if o_text_editor is initial.

CREATE OBJECT o_text_editor .....

endif.

Also verify the value of gv_tbox_scr.

former_member249399
Active Participant
0 Kudos
271

HI,

AS suggested link by Eitan , refer below code

FORM toggle_mode .

* define local data

  DATA: ld_mode     TYPE i.

  if ( gd_mode = cl_gui_textedit=>true ).

    gd_mode = cl_gui_textedit=>false.

    else.

      gd_mode = cl_gui_textedit=>true.

      endif.

  CALL METHOD go_textedit->set_readonly_mode

    EXPORTING

      readonly_mode          = gd_mode

    EXCEPTIONS

      error_cntl_call_method = 1

      invalid_parameter      = 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.

ENDFORM.                    " TOGGLE_MODE

raymond_giuseppi
Active Contributor
0 Kudos
271

Did you call method cl_gui_cfw=>flush at end of PBO ?


Regards,

Raymond