Skip to Content
author's profile photo Former Member
Former Member

Problem In displaying Text in text editor using cl_gui_textedit

Hello Experts,

I have created a customer container and using class cl_gui_textedit to have a text editor on the screen and saving the text as standard text.

Problem is when i save the test say TEST TEST TEST TEST , it get saved properly but when i display it the last word is getting shifted to next line

like TEST TEST TEST

TEST

and vertical scroll bar is getting displayed, but if i go back and come again the scroll bar is no more there and text is displayed properly TEST TEST TEST TEST.

I couldnt find any method to control the scroll bar ,

request for a solution and thanks in advance .

Thanks

Pramod Adhav

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2010 at 05:06 AM

    Hi,

    Try by using this method SET_WORDWRAP_BEHAVIOR

    (Use this method to set the behavior of the line break. I am not sure which parameter you have to use )

    call method textedit set_wordwrap_behavior

    exporting

    wordwrap_to_linebreak_mode = '0'. " (also Try by '1')

    exceptions

    error_cntl_call_method = 1.

    Hope this will help you

    Regrads,

    Raghava Channooru

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 11, 2011 at 03:01 PM

    Maybe your container lenght is smaller than 72 chars (stantard for sapscript and SO10).

    So when you save it you can see the text on the same line, and then when displaying on smaller line lenght it makes a line return.

    Anyway I haven't had any problem with it. Here I show you how I usually define it when used:

    CREATE OBJECT GV_TEXT_EDITOR
      EXPORTING
        PARENT = GV_SPLITTER->BOTTOM_RIGHT_CONTAINER
        WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_WINDOWBORDER
        WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
      EXCEPTIONS
        ERROR_CNTL_CREATE      = 1
        ERROR_CNTL_INIT        = 2
        ERROR_CNTL_LINK        = 3
        ERROR_DP_CREATE        = 4
        GUI_TYPE_NOT_SUPPORTED = 5.

    And some useful options:

    *READ ONLY
     call method gv_text_editor->set_readonly_mode
       exporting
         readonly_mode = gv_text_editor->true
       exceptions
         error_cntl_call_method = 1
         invalid_parameter      = 2
         others                 = 3.
    
    *NO TOOLBAR
      call method gv_text_editor->SET_TOOLBAR_MODE
       exporting
         TOOLBAR_MODE = gv_text_editor->false
       exceptions
         error_cntl_call_method = 1
         invalid_parameter      = 2
         others                 = 3.
    
    *NO STATUS BAR (bottom one)
     call method gv_text_editor->SET_STATUSBAR_MODE
       exporting
         STATUSBAR_MODE = gv_text_editor->false
       exceptions
         error_cntl_call_method = 1
         invalid_parameter      = 2
         others                 = 3.
    

    I hope it helps

    Regards,

    John

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.