cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a popup window for entering text

martin_svik2
Participant
0 Kudos

hi there,

i know there are methods like IF_WD_WINDOW_MANAGER~CREATE_AND_OPEN_POPUP and others to open a popup and display buttons there etc.....

my requirement is to open a popup where the user can enter text, which can be endless long. After entering the text he should confirm it with OK button.

is there any standard in web dynpro abap to open such an "note editor" ?

br Martin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Martin,

There is a standard method create_window from interface IF_WD_WINDOW_MANAGER which may help you to solve your problem.please follow below steps

1. create a pop up view(V_POPUP) and place the UI element TEXTEDIT( work as a long editor)

2. bind the UI element with string for long text

3. create a new window(W_POPUP) ,embedded the view(V_POPUP) to W_POPUP

4. Call the pop up window by using the method create window (insert below given code in side your action/method where you need to call the pop up view)

6. create a action called " OK_SAVE"(in action Tab of view) to handle your OK button functionality       and write you save text logic inside the OK_SAVE action

7. if you need endless text better go with standard text which will help to store long texts in sap

DATA lo_window_manager TYPE REF TO if_wd_window_manager.

DATA lo_api_component  TYPE REF TO if_wd_component.

DATA lo_window         TYPE REF TO if_wd_window.

lo_api_component  = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window         = lo_window_manager->create_window(

                   window_name            = 'W_POPUP'

                  title                  = 'Enter text'

                  close_in_any_case      = abap_false

                   message_display_mode   = if_wd_window=>co_msg_display_mode_selected

*                  close_button           = abap_true

                   button_kind            =  IF_WD_WINDOW=>CO_BUTTONS_OK

                   message_type           = if_wd_window=>co_msg_type_none

*                   default_button         = if_wd_window=>co_button_ok

                   ).

lo_window->open( ).

"OK action functionality

  DATA lo_api_v_main TYPE REF TO if_wd_view_controller.

  lo_api_v_main = wd_this->wd_get_api( ).

CALL METHOD lo_window->subscribe_to_button_event

  EXPORTING

    button            = IF_WD_WINDOW=>CO_BUTTON_OK

*    button_text       = 'OK'

*    tooltip           =

    action_name       = 'OK_SAVE'         "pass your action name here

    action_view       = lo_api_v_main

*    is_default_button = ABAP_FALSE

    .

  


Thanks

Nidhi

martin_svik2
Participant
0 Kudos

Hi Nidhi,

thank you for that, but i ask myself one thing: i am working with abap ("classic") for 25 years now. now i am forced to use web dynpro abap.

in "classic" abap there are plenty of function modules to achive this. it is done in 3 minutes.

why is it neccesary to do this manually in web dynpro abap ? I cannot believe that there are not standard function calls /methods there ?!?

br Martin

martin_svik2
Participant
0 Kudos

I have tried the solution now. i am able to enter text now, BUT: the text in heading differs, so the window has different size every time. the text box has always the same size, so this looks not very nice See the 2 screenshots.

so one more time  my question: i cannot believe that there are easy to use sap standard functions for that ?!?

br Martin

Former Member
0 Kudos

The pop up is a window inscribing a view(which is currently displaying you the text edit UI element) and you can always fix a size for the UI element, observe properties height and width of the UI element--

Give some values (like 60 and 80 respectively) as per your requirement to see how it appears.

Hope this helps.

Regards

Mohit

Former Member
0 Kudos

Hi Martin,


You can control the size of the textedit UI element from the property as Mohit Kumar told above on above post or you can put it inside a transparent controller where you will have the control over the size .


Coming to your question

so one more time  my question: i cannot believe that there are easy to use sap standard functions for that ?!?



I'm not sure, is there any standard method/FM available in Webdynpro , might be its not possible in WD because  the output is displaying on portal level not on a normal screen.


In normal ABAP also,might be inside the FM they might have called a screen which may  hold a Custom Control to achieve the functionality.

As per your requirement by using TEXTEDIT  UI element we can achieve this.



Thanks

Nidhi






former_member218528
Participant
0 Kudos

Hi Martin,

You can use the Below method of IF_WD_WINDOW

  lo_window->set_window_size( width = '20%' height = '20%' ).

  LO_WINDOW->OPEN( ).

Regards,

      Rohan