二维码

[教程] NAVIGATIONAL LINK CREATION

Twilight发表于 2015-12-04 23:46Twilight 最后回复于 2015-12-04 23:46 [复制链接] 2395 0

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.
inoutbound 1.jpg

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.
inoutbound 2.jpg

Creating navigational link:
Go to the run time repository and click on the edit button. Right click on navigation links and choose create.
inoutbound 3.jpg

In the next Dialog box, choose the values as shown below. Give the meaningful name to the link.
inoutbound 4.jpg

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.
  1. METHOD eh_onobjectid.

  2.   "calling the outbound plug of the view to start the navigation.

  3.   op_tooverviewpage( ).

  4. ENDMETHOD.
复制代码

Open the outbound plug method in the result view and add the following code to it.
  1. METHOD op_tooverviewpage.

  2.   me->view_manager->navigate( EXPORTING outbound_plug = 'FromResultToOverView' "navigationlink name
  3.                                         source_rep_view = me->rep_view ).

  4. 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.
inoutbound 5.jpg

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.
回复

使用道具 举报

快速回帖

本版积分规则
您需要登录后才可以回帖 登录 | 注册有礼

快速回复 返回顶部 返回列表