二维码

[教程] CREATING A SEARCH VIEW

Twilight发表于 2015-12-02 22:52Twilight 最后回复于 2015-12-02 22:52 [复制链接] 2575 0

SEARCH VIEW:Visiting any transaction information first requires a search. We need to search the required business object, and then we can view its information.

Let us build a search view, which will give us an ability to search service contracts.

VIEW:A block that is used to display the certain information on the WEB UI.  In the entire component hierarchy view comes at the bottom place.

Every view has one controller class. Generally we call it as view implementation class. The class name generally ends with *IMPL suffix.

In order to display any view on web ui, it must be assigned to either window or to VIEW SET ( here again VIEW SET must be assigned to the WINDOW).

Open the component and click on component structure browser and right click on VIEWS and select the view. We can see another option ‘CREATE SEARCH PAGE’. This is a new feature available EHP 1. As we want to know the concepts, choose just ‘CREATE’ option.
search 1.jpg

Enter view name and choose continue.
search 2.jpg

In the next step, we need to add the model node.
  • MODEL NODE:Any context node that is based on any BOL entity, is called Model node.
  • VALUE NODE:Any context node that is not based on any BOL entity is called VALUE NODE.

Here we will add model node because we have bol entity. Here we are going to create search page. So we will select a BOL entity that will help us to search the contracts. We will look for objects that belong to dynamic search objects category in the one order MODEL.

Enter the context node name and choose the BOL entity as shown below.  Once you entered the details choose continue.
search 3.jpg

BTQSrvCon is a dynamic search object used to find service contracts.  We can check it in the GENIL MODEL BROWSER transaction in the ONEORDER component set , under the DYNAMIC QUERY OBJECT node.

In the next step, we need to enter the value node. However we are not dealing with any value node here, just press continue until you reach the last step ‘SELECT VIEW TYPE’ as shown in the below screenshot. Select the view type as EMPTY and complete the wizard. In the last complete step, it will summarize the all details , that we have entered so far.

Then we will be asked to save the view. If we observe carefully, we can see the framework will create certain classes.

Context node class.
ZL_ZTUTCOMP_SEARCHPAGE_CN00
Just double click the newly created view, all the classes that were created will be presented in the tree hierarchy. At bottom , we have context node class. This class will hold the data for our view. We can see all attributes of BOL entity that we added under this class. This class will have most important attributes and methods to manipulate the data.
search 4.jpg

Context class.

ZL_ZTUTCOMP_SEARCHPAGE_CTXT

Every view will have one context class controller, ends with *CTXT suffix.  If there is any context node exists, then it will be an attribute of this context class. Here we have one context node SEARCH; we can see this node as property of above class. Just double click on the context class.
search 5.jpg

View implementation class

ZL_ZTUTCOMP_SEARCHPAGE_IMPL.

This is main view controller and will be responsible for handling all events raised in the view. The context class will be an attribute of view controller.  We can in the below screen shot the context class became an attribute with the name TYPED_CONTEXT.
search 6.jpg

So in order to access any context node from a method in the view controller, generally we see the below syntax.

ME->TYPED_CONTEXT->SEARCH (here ME refers instance of view controller class).  You can find this syntax in almost all UI components.

So far we have designed just controllers. We did not design anything that user can see on the screen that is layout. We will design the layout  in the next chapter.
回复

使用道具 举报

快速回帖

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

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