cancel
Showing results for 
Search instead for 
Did you mean: 

Popup Window Generation query

YogSSohanee
Participant
0 Kudos

hi,

My Requirement is as follows:

1) I have a login window with Login view.

It has the UI elements as

->2 Inputfields (user name and password)

->2 labels(user name and password)

->1 Button (Submit)

2) In Component Controller context i have 2 attributes user id and pwd, which i have linked with a Z table fields . Table ZUSER_TAB_TEST-USER_ID and ZUSER_TAB_TEST-USER_PWD.

3) After clicking on submit button i need to check the values entered in inputfields with the z table values. If the values are matching then it should route the control to the next view with a popup showing a sucess screen with ok button.

And if the values are not matching then i shall get error message and on clicking on OK button(which is on popup) i shall again routed back to the main login screen.

Could you please help me out in getting this.

Many Thanks in advance!!

Regards,

Yogesh

Edited by: YOGESHSOHANEE on Feb 8, 2010 9:46 AM

Edited by: YOGESHSOHANEE on Feb 8, 2010 9:47 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

On click of you submit button first you need to validate your user name and password, I guess that is not the problem. Once you get the values now for e.g. if its valid you need to perform following steps:

1. Open a popup window to show success with OK button.

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.

data lv_message type string.

data lt_message type string_table.

data lo_view_ctrl type ref to if_wd_view_controller.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_view_ctrl = wd_this->wd_get_api( ).

lv_message = u2018SUCCESSu2019.

insert lv_message into TABLE lt_message.

CALL METHOD LO_WINDOW_MANAGER->CREATE_POPUP_TO_CONFIRM

EXPORTING

TEXT = lt_message

BUTTON_KIND = IF_WD_WINDOW=>CO_BUTTONS_OK

MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_WARNING

WINDOW_POSITION = IF_WD_WINDOW=>CO_CENTER

  • WINDOW_WIDTH = '100PX'

  • WINDOW_HEIGHT = lv_height

RECEIVING

RESULT = lo_window.

CALL METHOD LO_WINDOW->SUBSCRIBE_TO_BUTTON_EVENT

EXPORTING

BUTTON = 1 "OK

  • BUTTON_TEXT =

  • TOOLTIP =

ACTION_NAME = 'TONEXTVIEW'

ACTION_VIEW = lo_view_ctrl

  • IS_DEFAULT_BUTTON = ABAP_FALSE

.

Here in this code you are opening a window with 'Success' message and an OK button. Then you are assigning an action to this button by calling SUBSCRIBE_TO_BUTTON_EVENT method. Here in e.g. action is TONEXTVIEW'.

2. Navigating to second view on click of OK button:

2.1 Create an action with name TONEXTVIEW.

2.2 In the event handler method of the action you need to fire plug to your second view.

  • In case of invalid user name password you need to create popup with differnet message and on click of OK you need not to navigate anywhere so dont subscribe button to any action.

I hope its clear. Please ask in case you have doubt anywhere.

Regards,

Neha Modi Mehta