on 08-29-2007 2:07 PM
Hello experts,
I have a very simple Web Dynpro component:
- 2 views
- First view has an input field that is linked to a date field in the context and a button to navigate to the second view
- Second view has a button to navigate back to the first view
- There are no individual field validations implemented
If I now enter a date in a wrong format and press the button, the program navigates to the second view and displays an error message in the Message Area (comes from the WD4A framework). And in this second view the navigation is cancelled and I can't get back to the first view to correct the date.
Is this the correct behaviour? This does not make any sense to me. I would have expected that the navigation is cancelled in the first view so that it is not possible to leave the screen with the faulty data.
Referring to the book "Web Dynpro for ABAP" by Ulli Hoffman the validation of type definitions is the very first step in the phase model of the request/response cycle. But it seems as if navigation comes first and validation of type definitions comes second.
Is there a way to start the standard field validation earlier (for example in the wddobeforeaction method) so that navigation is stopped in the first view until the user enters a correct date?
Thanks, Karsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry, now I read better your question.
What about getting the instance of the message manager and verify if it is empty?
get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
IF sy-subrc EQ 0.
lo_api_controller ?= wd_This->Wd_Get_Api( ).
*
CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER
RECEIVING
MESSAGE_MANAGER = lo_message_manager.
IF lo_message_manager->is_empty( ) IS initial.
fire your plug <-------
Sergio
hi,
if you implement in your eventhandler of the button a check to the
message_manager to see if there are any messages you can solve it
use the magic wand button to create message,
but wipe out all the code except the one where you get the message manager instance
do lo_message_manager->is_empty( ).
if true
fire navigation plug
else
exit.
endif.
grtz,
Koen
sorry took me too long to type it
Message was edited by:
Koen Labie
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.