Creating navigation from one to another view needs understanding of certain methods in the framework.
There are certain entry and exit points to a view, which are called plugs.
INBOUND PLUG: this is a method which acts an entry point to the view.
OUTBOUND PLUG: this method acts as a leaving point from the view.
Let us take two views A and B. if we want to navigate from view A to view B. then we will create a outbound plug in the view A as we are moving away from A and one inbound plug in the view B as we are moving near to B.
How framework knows the source and target?
Navigational link.
We define it in the run time repository. This link provides the source and target information to the frame work.
Let us create plugs first.
Create one outbound plug in the result view as it is a source view. Go to the result view and right click on outbound plug and choose create option.
Give any valid name. Framework automatically adds prefix ‘op’. we have given ‘TOOVERVIEWPAGE’.
Go to the overview page and create one inbound plug. Use the above method to create inbound plug.
Creating navigational link:
Go to the run time repository and click on the edit button. Right click on navigation links and choose create.
In the next Dialog box, choose the values as shown below. Give the meaningful name to the link.
Source is our result view and target is overview page. Choose continue and save the repository.
As discussed, in order to navigate to the over view page, still little coding effort is required. Go to the event handler (eh_objectid) in the result view. Call the outbound plug in this event handler as shown below.
METHOD eh_onobjectid.
"calling the outbound plug of the view to start the navigation.
op_tooverviewpage( ).
ENDMETHOD.
复制代码
Open the outbound plug method in the result view and add the following code to it.
METHOD op_tooverviewpage.
me->view_manager->navigate( EXPORTING outbound_plug = 'FromResultToOverView' "navigationlink name
source_rep_view = me->rep_view ).
ENDMETHOD.
复制代码
We have completed the navigation part. Test the application. Carry the search and click on any hyperlink in the result list. We will be taken to the overview page. We got following screen.
Oops, there is no data in the view.
Yes, we just completed the navigation. We did not feed any data to this view.
How we will do it?
We will create one new context node in the existing custom controller.
In the event handler that we trigger when user clicks on the hyperlink, we will feed the data to this context node.
We will bind the context node of header view to the context node of custom controller so that data will flow to the header view.
Let us create a context node in custom controller.
There are certain entry and exit points to a view, which are called plugs.
Let us take two views A and B. if we want to navigate from view A to view B. then we will create a outbound plug in the view A as we are moving away from A and one inbound plug in the view B as we are moving near to B.
How framework knows the source and target?
Navigational link.
We define it in the run time repository. This link provides the source and target information to the frame work.
Let us create plugs first.
Create one outbound plug in the result view as it is a source view. Go to the result view and right click on outbound plug and choose create option.
Give any valid name. Framework automatically adds prefix ‘op’. we have given ‘TOOVERVIEWPAGE’.
Go to the overview page and create one inbound plug. Use the above method to create inbound plug.
Creating navigational link:
Go to the run time repository and click on the edit button. Right click on navigation links and choose create.
In the next Dialog box, choose the values as shown below. Give the meaningful name to the link.
Source is our result view and target is overview page. Choose continue and save the repository.
As discussed, in order to navigate to the over view page, still little coding effort is required. Go to the event handler (eh_objectid) in the result view. Call the outbound plug in this event handler as shown below.
Open the outbound plug method in the result view and add the following code to it.
We have completed the navigation part. Test the application. Carry the search and click on any hyperlink in the result list. We will be taken to the overview page. We got following screen.
Oops, there is no data in the view.
Yes, we just completed the navigation. We did not feed any data to this view.
How we will do it?
Let us create a context node in custom controller.