二维码

[教程] CREATING VIEW SET

Twilight发表于 2015-12-04 22:56Twilight 最后回复于 2015-12-04 22:56 [复制链接] 2836 0

Let us create a view set to display the two views that we have created. in the previous chapter, we are able to display only one view. in order to show more than one view on the screen, we need to create view set.

Go to the UI component- component structure browser. Right click on views and select create view set option from the context menu.
view set 1.jpg

Give a name to the view set.
view set 2.jpg

Here grid size refers to the number of rows and columns that we need to arrange the views. Here we have two views and one column. Something looks like below. So we have given 2 and 1 as grid size.
Search
Result

In the next step, we create view areas. Views will be assigned to this view areas in the runtime repository. We will create two view areas so that each view will take one view area.
view set 3.jpg

Except the result area row value, all cell values are 1. Complete the wizard and save it. We have created view set now.

We need to assign the two views to the view set first and then view set will be assigned to the window.

Go to the runtime repository , expand the view set node and choose the searcharea and right click on and select the add view option.
view set 4.jpg

In the next popup box, choose the search view and continue. View will be added to the view area.
view set 5.jpg

Repeat the same process to add the result view to the result area view area. Then save the runtime repository using the save button.

Something wrong we got the following error.

‘Multiple usage of view is not possible’.

Cancel the popup and  press on NO in the next pop up.

Yes, because we already added two views to window. So go to the window and right click on the view and choose remove.
view set 6.jpg

Repeat the same to remove the result view from window.

Now save the repository. This time there won’t be any error.

Next we will assign view set to the window. Follow the same process of adding view to window, to add the view set to the window.

Right click on window and choose the option add view. In the next pop up select the view set and choose continue. Save the runtime repository.

So far what we have done is,
Added views to view set and view set to window.  Repository will look like below.
view set 7.jpg

Now test the application. See the difference in the output.
view set 8.jpg

Yeah, it is not a nice format as there is no line between search and result. Let us focus on the content first rather than the format.

So we have two views on the screen and we fetched the data in the search event handler. We need to move that fetched data from search view to result view.

We use Custom CONTROLLER to accomplish this job. Let us create Custom Controller in the next chapter.
回复

使用道具 举报

快速回帖

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

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