Friday, 24 May 2013

27.CREATING VIEW SET



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. 





Give a name to the view set. 






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. 






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. 






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







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. 



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.








Now test the application. See the difference in the output. 



 


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.
 



No comments:

Post a Comment