on 08-29-2011 8:07 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.