cancel
Showing results for 
Search instead for 
Did you mean: 

initialize webdynpro view after navigation

richard_pietsch
Active Contributor
0 Kudos

Hi experts,

I'm new to webdynpro and created a test application. I have a problem with the initialization of the selected view..

From a navigation bar I call view MAIN1 of component COMP1. There I have a roadmap designed with displays information and activities based on the selected step. Lets say I chose step3 and get all information displayed. Now I chose another link from the navigation bar which calls view MAIN2 of component COMP2.

When navigating back to MAIN1 of COMP1 via the navigation link there is still step3 selected in MAIN1.

How can I initialize view MAIN1 again when it is called from the navigation bar?

When pressing F5 of the browser all views are resetted to initial state but how can I get this result during the navigation?

Thanks in advance.

RP

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Richard,

You can reset the view's context nodes to their initial state, which should have the same effect. See method:

    if_wd_context_node->invalidate( ).

Using this method, you can reset individual nodes or, by using the view's wd_context attribute, reset all nodes of the view in one statement:

    wd_context->invalidate( ).

When you navigate from view MAIN1 via the navigation link, you can use this method to reset the context nodes of the view to their initial state.

Cheers,

Amy

richard_pietsch
Active Contributor
0 Kudos

Hi Amy,

yeah this were my thoughts too but these commands refer to the context of the component were the navigation bar is located, right? Can I also invalidate the context of a component which I maintained as "used web dynpro component" under component definition?

Regards, RP

amy_king
Active Contributor
0 Kudos

Hi Richard,

"Can I also invalidate the context of a component which I maintained as used web dynpro component"

Provided the used component's context node is defined as an interface node, in the view which has the component usage defined, you can drag-and-drop the interface context node from the used component's context to the view's context. Then in a view method, you can read and invalidate that context node as if it were any other context node.

The screen captures below are from demo Web Dynpro Component WDT_COMPONENTUSAGE where context node NODE_INTERFACE has been mapped from a used component's context to the context of view MAINVIEW.

Cheers,

Amy

richard_pietsch
Active Contributor
0 Kudos

Hi Amy,

thanks for the hint with the interface node. I finally managed it

I put all attributes that can be invalidated when calling the view again into one interface node on context level, mapped it to the MAIN1 view and also to the navigation bar view and put the invalidate( ) code right before firing the outbound plug.

Thanks!

RP

Answers (2)

Answers (2)

former_member222068
Active Participant
0 Kudos

Hi Richard,

    As per the architecture in Web Dynpro ABAP, view will be initialized only once. In WDA, WDDOINIT() is used as initialization. This method triggers only once in its life time i.e., till the application is closed.

As per your recruitment: write logic in  component controller  method( eg: Refresh_data ). Call this method in the respective on the back navigation.

Sample code to be used before navigation:

wd_comp_controller->refresh_data( ).    

wd_this->fire_to_view1_plg( ).

Note:

1. wd_comp_controller is the attribute which is used as instance or reference to access methods,data across the component globally

2. wd_this : is an attribute which is used as instance or reference, to call the methods of current controller

if you have any quires, you can reply with your quires

Thanks & Regards,

Sankar Gelivi.

;

richard_pietsch
Active Contributor
0 Kudos

Hi Sankar,

thanks for the reply.. any ideas how to fill refresh_data? As the single step information from VIEW1 is read via context I guess I need to use invalidate( ) here?

Regards, RP

m_aravindan
Active Participant
0 Kudos

Hi Richard,

                 Check the below link.

http://sapignite.com/creating-roadmap-application-in-webdynpro-for-abap-tutorial/

Regards

Aravindan