on 06-11-2008 9:57 PM
Hi,
I'm creating a 2 Views and 2 windows.
In 1st view when pressing a button I'm showing 2nd view as popup.
I used
1. lc_window_manager to create window.
2.button_kind = if_wd_window=>co_buttons_ok
It is working fine.
I want to validate the data entered in the popup window.
For ex: if the 2nd view as a inputfield of type string.
User should enter only string, if number occurs error should be displayed.
How to validate the data in popup?
I remove the button_kind and tried adding a button UI element in 2nd view.
But on pressing the 2nd view, how can i close the popup and return to the 1st view?
Thankx,
Hi Suba,
you can try the below code to open or close the popup.
Provided u have to maintain a variable as boolean.
If there is error/noerror u have to update the variable.
data l_error type boolean.
data: l_api type ref to if_wd_view_controller,
l_window_ctlr type ref to if_wd_window_controller,
l_popup type ref to if_wd_window.
l_api = wd_this->wd_get_api( ).
l_window_ctlr = l_api->get_embedding_window_ctlr( ).
if l_window_ctlr is bound.
l_popup = l_window_ctlr->get_window( ).
if ( l_popup is bound and l_error = abap_false ).
l_popup->close( ).
else.
wd_this->open_popup( ).
l_popup->open( ).
endif.
endif.
Hope it will help u.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nithya,
I tried ur code, but again it is showing the error msg in View1.
I tired by adding a button in View2 and on pressing the button I'm validating the fields. If there is no error how can i close the View2 and get the View1?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suba,
To close the view:
l_api TYPE REF TO if_wd_view_controller,
l_window_ctlr TYPE REF TO if_wd_window_controller,
l_popup TYPE REF TO if_wd_window.
l_api = wd_this->wd_get_api( ).
l_window_ctlr = l_api->get_embedding_window_ctlr( ).
IF l_window_ctlr IS BOUND.
l_popup = l_window_ctlr->get_window( ).
IF l_popup IS BOUND.
l_popup->close( ).
endif.
endif.
Do this if validations are successfull.
Regards,
Reema.
Reema,
I worked on the code. it works fine.
But it is showing the error msg in the View1, but I need the error msg to be displayed in the view2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What you can do is: use button kind ok....
in the 2nd view, do this:
in wddoinit
data:
l_api type ref to if_wd_view_controller,
l_window_ctlr type ref to if_wd_window_controller,
l_popup type ref to if_wd_window.
l_api = wd_this->wd_get_api( ).
l_window_ctlr = l_api->get_embedding_window_ctlr( ).
if l_window_ctlr is bound.
l_popup = l_window_ctlr->get_window( ).
if l_popup is bound.
l_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
button_text = 'Ok' "#EC *
action_name = 'OK_CLICKED'
action_view = l_api
is_default_button = abap_true ).
endif.
endif.
now in actions, create an action of the name OK_CLICKED.
Under Methods, you will get an event handler by the name ONACTIONOK_CLICKED
In this event handler, you can do all the validations you need to.
If validations fail, show message
else, close the window
Regards,
Reema.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.