11 Replies Latest reply: Jan 11, 2010 11:32 AM by Karthik Vishwamurthy RSS

Pop-up window in Web UI

vishwas sahu
Currently Being Moderated

Hi All,

         I want to develop a Pop-up in crm web ui.how a pop-up can be developed  in web ui.and i want show simple hello word in popup.can any one help me?

 

Thanks in Advance

 

Vishwas

  • Re: Pop-up window in Web UI
    Masood Imrani
    Currently Being Moderated

    Hi,

    There are many methods to do this.It depends on the way and the action required to launch the pop up and the info to be shown in the pop up.There are many standard methods to create a pop up in this interface IF_BSP_WD_WINDOW_MANAGER.

     

    A sample snippet...to show a decision pop up.

     

      CALL METHOD comp_controller->window_manager->create_popup_2_confirm

            EXPORTING

              iv_title          = lv_title

              iv_text           = lv_text

              iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_okcancel

            RECEIVING

              rv_result         = confirm_popup.

     

          confirm_popup->set_on_close_event( iv_event_name = 'POPUP_CLOSED' iv_view = me ).     ENDIF.

     

        confirm_popup->open( ).

     

    Regards,

    Masood Imrani S.

    • Re: Pop-up window in Web UI
      vishwas sahu
      Currently Being Moderated

      Hi Masood Imrani ,

                                   Thanks for ur quick reply. Can you tell me one thing also where should i write this code . and how to handle this popup .want to create any custom component for that or simply write in standard component.I want handle this popup by action

       

       

      Thanks in advance.

       

      Vishwas

      • Re: Pop-up window in Web UI
        Masood Imrani
        Currently Being Moderated

        Vishwas,

        This code is used to open a pop up on a button click.No need to create a custom component again.

        Add a button on whichever standard component you want to display this pop up.

        The buttons will be available in either DO_PREPARE_OUTPUT or IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS depending on the type of view.In the event handler for the button,write this code. All the coding is using TCODE BSP_WD_CMPWB.

         

        Now, in the code I earlier mentioned if you pass

        iv_btncombination = 0 and

        lv_text = 'Hello', you will get the required thing.

         

        It is good if you debug any standard components and find out what is happening.

        This way you will get lot of info.

         

        Regards,

        Masood Imrani S.

        • Re: Pop-up window in Web UI
          Masood Imrani
          Currently Being Moderated

          The standard component and the view where the button is required need to be enhanced and then the on click action event handler can be created there and the code can be implemented.

          In the IMPL class the confirm_popup attribute needs to be declared of type IF_BSP_WD_POPUP.

          • Re: Pop-up window in Web UI
            vishwas sahu
            Currently Being Moderated

            Hi Masood,

                            can you tell me plz how to enhance any component.

             

             

            thanks

            Vishwas

            • Re: Pop-up window in Web UI
              Masood Imrani
              Currently Being Moderated

              First you need to identify the component and the view to be enhanced by doing an F2 on the UI.

              Then you need the enhance the component.

              Before doing that an enhancement set needs to be in place. To do that ...

              1. Use TCODE SM34 and give view cluster-BSPWDVC_CMP_EXT and create an EHSET.

              2. Assign a Client in TCODE SM30 using view - BSPWDV_EHSET_ASG.

               

              Once you do this, use TCODE BSP_WD_CMPWB, open the component you want to enhance and click display by keying in the EHSET. Now, on the top right corner click the ENHANCE COMPONENT button,

              specify a BSP application and enhance(say yes when it asks to create the BSP application).

               

              Now come out of the Transaction and open it again. Now you cannot see the ENHANCE COMPONENT button anymore. Right click on the view where the button needs to be added and enhance it.The view text(name) will be in grey colour earlier, once enhanced they will become black and the Z IMPL and CTXT classes get created.

               

              There are mant threads in this forum on similar topics like adding new fields etc.,the initial steps to enhance the component and view are same.

              • Re: Pop-up window in Web UI
                vishwas sahu
                Currently Being Moderated

                Hi Mahssod,

                                    finelly i wantto ask one more thing we can create a method "eh_ on_click" in the implemenation class, right ? for instance if i want to create a pop up in the Ibase , i will create  a button , when the user press the button the method will be called .this is right.

                 

                 

                thanks

                 

                vishwas

                • Re: Pop-up window in Web UI
                  Masood Imrani
                  Currently Being Moderated

                  The button gets created if you write this code on the method I mentioned earlier.(DO_PREPARE_OUTPUT or TOOLBAR Get Buttons).

                    ls_button-page_id       = me->component_id.

                    ls_button-id = 'NEW'.

                    ls_button-text = 'NEW'.

                    ls_button-tooltip = 'NEW'.

                    ls_button-on_click = 'PUSHNEW'.

                    ls_button-type     = cl_thtmlb_util=>gc_icon_new.

                    ls_button-enabled = abap_true.

                    APPEND ls_button TO rt_buttons.

                   

                  Whatever value you pass in ls_button-on_click, you need to create an event handler with this name

                  like EH_ONPUSHNEW and write code there. This gets called when the button is clicked.

                  Actually this event handler is called from method DO_HANDLE_EVENT in IMPL class which is like PAI in dialog programs.

Actions