cancel
Showing results for 
Search instead for 
Did you mean: 

View instance within ViewContainerUIElement

Former Member
0 Kudos

Hi,

I have a Main-View V_MAIN with a ViewContainerUIElement which displays the Sub-Views V_SUB1 and V_SUB2 etc. If I navigate to the next View, I want to check the mandatory fields of the current view with method WDDOBEFOREACTION of V_MAIN.

I've found this solution: http://scn.sap.com/message/10266248#10266248  This will work but it will give me the Runtime Repository Object of the View (IF_WD_RR_VIEW) but I need the View or View Controller for checking mandatory fields with CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( ).

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Christian,

The validations to be done in the method WDDOBEFOREACTION of respective view i.e., subview.

I appreciate if you could elaborate your scenario and reason for validating sub view elements in Main view.

Regards,

Rama

Former Member
0 Kudos

Hi,

the navigation buttons NEXT and BACK are in the Main-View so I did not get these actions within my Sub-View.

ramakrishnappa
Active Contributor
0 Kudos

Hi Christian,

Yes, you are right. The actions related to main view will not be bound in any other view's action.

Solution:

  1. Create an attribute GO_CURRENT_ACTION in Component controller
  2. As subviews are embedded in the Main view, the WDDOBEFORE ACTION of main view is called first and then subviews. Hence you can get the current action of Main view in WDDOBEFOREACTION( ) method and assign it to GO_CURRENT_ACTION     i.e. WD_COMP_CONTROLLER->GO_CURRENT_ACTION = ( MAIN_VIEW ) -> GET_CURRENT_ACTIO
  3. Now you can access this action in sub view's wddobeforeaction method and proceed with the validation

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi,

this is a really good idea and it works great! Thank you.

Answers (0)