cancel
Showing results for 
Search instead for 
Did you mean: 

Navigating from one View to Another View Depending upon URL parameters

Former Member
0 Kudos

Hi All,

I have a requirement in which I need to navigate from one View to another depending upon URL parameters. I'll explain the detailed requirement below.

I have an Application1 which has View1 and View2. View1 is the default view which has a table and upon lead select of the table it navigates to View2. The application can be accessed directly from Portal or can be accessed using a hyperlink from Application2. When Application1 is called from Application2 the lead select value is sent as a URL parameter. I am reading the URL parameter in the HANDLEDEFAULT plug of the main window using method

call method wdevent->get_data

exporting

name = if_wd_application=>all_url_parameters

importing

value = lt_parameter.

When there is a particular parameter in the URL I need to go to View2 directly.

When I am calling the navigation plug in WDDOMODIFYVIEW I am getting a dump saying that Navigation cannot be triggered in WDDOMODIFYVIEW. WDDOBEFOREACTION,WDDOAFTERACTION methods are not getting triggered as none of the buttons are pressed.

Please let me know how we can handle the above scenario.

Thanks in Advance.

Regards

Sandeep

Accepted Solutions (1)

Accepted Solutions (1)

saravanan_narayanan
Active Contributor
0 Kudos

Hello Sandy,

do the following.

1. In the component Controller

a. Create a context node of cardinality 1..1 and an attribute to store the parameter value

b. create an event NAVIGATE_SECOND

c. in the Before_navigation method, check for the context attribute. If its set with the expected value and fire the event NAVIGATION_SECOND

2. In the View controller

a. Create a EVENT HANDLER method for the NAVIGATE_SECOND event of the Component controller

b. in the event handler fire the OUT plug which will navigate to the second view

3. in the Window controller

a. map the component controller context node to window controlle context

b. receive the url parameter and populate the context attribute

this will solve your problem

BR, Saravanan

Former Member
0 Kudos

Hi Saravanan,

The solution has worked. Assigned points.

Kiran,

Your solution would still give a dump. Anyway thanks for your inputs.

Regards

Sandeep

Answers (2)

Answers (2)

former_member184578
Active Contributor
0 Kudos

Hi.,

In HANDLEDEFAULT plug of the main window using method

call method wdevent->get_data

exporting

name = if_wd_application=>all_url_parameters

importing

value = lt_parameter.

get the particular url parameter value.,

take a node with one attribute in component controller and map it to view1.

now in handeldefault method map the component controller node and set the value of url parameter to the attribute.

now in WDDOINIT method.,

read the attribute ,.

if lv_url_attr_value = 'Your Condition

fire to second view. " fire plug

else.

do the coding for first view.

endif.

hope this helps u.,

Thanks & Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

WDDOINIT of Windows and View is triggered first and then the application goes to Handledefault from where I am getting the URL. So in WDDOINIT I do not have the required URL parameter.

former_member184578
Active Contributor
0 Kudos

Hi.,

Yes INIT will call first . You do the same in WDDOMODIFY View. If it is giving dump.,

create a method nav_view2 in methods tab and place code to call second view .,

now in Modify view method.,

if url_parameter is set.,

wd_this->nav_view2( ). " call method to navigate.

hope this helps you..

Thanks & Regards,

Kiran

former_member199125
Active Contributor
0 Kudos

Hi Sandeep,

Why dont you simply fire the navigation plug in onselect method.

No need of passing url parameters.

In on lead select method just fire the outbound plug.( maintain navigation between two views )

wd_this->fire_plugname_plg( ).

let me know if you have any queries

Regards

Srinivas

Former Member
0 Kudos

Hi,

When the application is opened on its own the navigation plug is fired in the method lead select and is working fine. When the application is called from a second application the view1 should not be displayed and it should go to View2 automatically. User does not want to do any actions when it is called from second application.

Regards

Sandeep