Siebel Developer's Reference > Tags >

swe:view, swe:current-view


The SWE framework supports showing multiple views simultaneously on a page. The multiple views consist of a "Main" view and one or more "Alternate" views. The main view is the view that is selected using the viewbar (Level 2 or 3) for a given screen. There will always be only one main view. Alternate views are other views that can be shown along with the main view; for example, the Search View that shows applets that can be used for find/search operations.

The multiple views shown on a page can be placed into separate HTML frames or can share the same frame. Moreover, multiple views can be shown on the main browser window or in pop-up windows.

The examples in this document describe creating multiple view layouts when SWE frames are used. The process is similar when frames are not used. In such cases HTML tables can be used in the place of frames and framesets to position the views.

To support multiple views, the structure of framesets and frames used in the application needs to be modified. In addition to frame sets and frames, you must also modify an a layer called the "Content Container." You can think of this as the container page for the Content area.

The frame of type "View," which used to be in the Application's Container page, should be replaced with a frame of type "Content." This frame defines the area where one or more views can be loaded. Initially this frame will contain a frameset that will have the "View" type frame.

The new structure of the container template should be something like that given below:

<swe:frameset htmlAttr="rows='80,50,50,*' border='0' frameborder='No'">

<swe:frame type="Page" htmlAttr="marginheight='0' marginwidth='0' noresize scrolling='No'">

<swe:include file="CCBanner.swt"/>

</swe:frame>

<swe:frame type="Screenbar" htmlAttr="marginheight='0' marginwidth='0' noresize scrolling='No'">

<swe:include file="CCScreenbar.swt"/>

</swe:frame>

<swe:frame type="Viewbar" htmlAttr="marginheight='0' marginwidth='0' noresize scrolling='No'">

<swe:include file="CCViewbar.swt"/>

</swe:frame>

<swe:frame type="Content" htmlAttr="marginheight='0' marginwidth='0' noresize scrolling='Yes'">

<swe:include file="CCMainView.swt"/>

</swe:frame>

</swe:frameset>

The file CCMainView.swt will define a frameset that contains the main view.

<swe:frameset htmlAttr="cols='100%' border='0' frameborder='No'">

<swe:frame type="View" htmlAttr=" noresize scrolling='Yes'">

<swe:current-view/>

</swe:frame>

</swe:frameset>

After making this change, the application should behave as before. An additional layering of frames in the content area was introduced. The previous application container page template that had the "View" frame without the outer "Content" frame will not generate any errors, but will not allow showing multiple views in the application

To show additional views in the content area, we load a different "Content Container" page in the "Content" frame. This can be done by invoking the method "LoadContentContainer" from a control or page item. The "Content Container" to be loaded should be passed in using the User Property "Container."

NOTE:  This should be set to the Web Template Name of the content container page and not to the SWT filename.

For example, to show the search view along with the main view, create a content container page, say "CCSMainAndSearchView.swt", and load it using the "LoadContentContainer" method. CCSMainAndSearchView.swt will contain the tags to load the main view and search view into two frames as shown:

<swe:frameset htmlAttr="cols='100%' border='0' frameborder='No'">

<swe:frame type="View" htmlAttr="noresize scrolling='Yes'">

<swe:current-view/>

</swe:frame>

<swe:frame type="AltView" name="Search" htmlAttr="noresize scrolling='Yes'">

<swe:view name="Search View" id="Search" />

</swe:frame>

</swe:frameset>

The main view is still referred to by the <swe:current-view> tag. Alternate views are referred to using the new <swe:view> tag.

swe:view

Syntax

<swe:view name="xxx" id="yyy">

Attributes

Name. Name of the Alternate View.

Id. An Id for the location (or zone) occupied by this view. This ID will be used to replace this view with another view in its place.

swe:current-view

The location or zone occupied by an alternate view is identified by the View ID, which is "Search" in the above example. This is necessary because, just as with the main view, we want to be able to navigate to other views. In other words, we have multiple view zones now. In the above example, SWE will navigate to the Search view automatically when the Search View Zone is shown the first time. After that, the specialized frame code in the Search view can do a BuildViewAsync() or provide controls of GotoView invokemethod for the users to navigate to other views. The main view has a NULL view ID.

When calling BuildViewAsync(), set the pViewId parameter to the desired View ID. If you are calling from a frame, you can use the frame's view ID, which is set in the data member m_cszViewId of the frame. This will cause a navigation to another view within the same view zone. You can also cause the main view to navigate to another view using BuildViewAsync(). Just make sure you set the pViewId parameter to NULL.

To get the desired view, you can call:

CSSSWEFrameMgr::GetView (const SSchar* pViewId = NULL);

In other words, you can call:

m_pFrameMgr->GetView() to get the main view.

m_pFrameMgr->GetView ("Search") to get the Search view.

The CSSSWEFrame contains a new data member now. It is m_cszViewId, which is the view to which it belongs.


 Siebel Developer's Reference 
 Published: 23 October 2003