Siebel Developer's Reference > SWE 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 view bar (Level 2 or 3) for a given screen. There is always 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 or 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 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 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 contains a frameset that has 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 type="Screenbar" htmlAttr="marginheight='0' marginwidth='0' noresize scrolling='No'">

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


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

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


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

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



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

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

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




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 does not generate any errors, but does allow showing multiple views in the application.

To show additional views in the content area, 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, for example "CCSMainAndSearchView.swt", and load it using the LoadContentContainer method. CCSMainAndSearchView.swt contains 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:frame type="AltView" name="Search" htmlAttr="noresize scrolling='Yes'">

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



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 name="xxx" id="yyy">


Name. Name of the Alternate View.

Id. An Id for the location (or zone) occupied by this view. This ID is used to replace this view with another 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, you want to be able to navigate to other views. In other words, there are multiple view zones now. In the above example, SWE navigates 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 causes a navigation to another view within the same view zone. You can also cause the main view to navigate to another view using BuildViewAsync(). Be sure to 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