The View Type tool is a BI Beans thin bean, for use in an HTML-client application. It allows users to change the type of the thin Dataview
that displays data. For example, you might put a View Type tool in the same page as a thin crosstab. The user can then use the View Type tool to change the view to a thin graph.
The ThinBeanUI
implementation of the View Type tool is the
oracle.dss.thin.beans.tools.ViewTypeTool
class. The UINode
for the View Type tool dialog is oracle.dss.thin.beans.tools.ViewTypeToolBean
.
To render the View Type tool, your servlet must associate
the ViewTypeTool
object with the ViewTypeToolBean
object.
The JSP tag for this tool is the ViewType
tag. In the UIX Language, the definition element is the viewTypeToolDef
element, and the UINode
is the viewTypeTool element.
The ViewTypeTool
should be stored in the HTTP session.
When you use the View Toolbar, you do not need to instantiate a ViewTypeTool
or the ViewTypeToolBean
. The View Toolbar instantiates and renders the View Type tool.
You do need to implement a ViewToolListener
to handle the VIEW_TYPE_CHANGED_EVENT
, which the ViewTypeTool
generates. Register the listener with the ViewToolbar
.
To use the View Type tool outside of the View Toolbar, instantiate the ViewTypeTool
and call its setView
method to specify the thin presentation bean that is displayed with the tool.
You must also implement a ViewToolListener
to handle the VIEW_TYPE_CHANGED_EVENT
, which the ViewTypeTool
generates. Register the listener with the ViewTypeTool
.
The View Type tool uses a default implementation of the GraphTypeConverter
interface to retrieve available graph types and subtypes. If you change the number of graph types or subtypes, then you should set your own GraphTypeConverter
on the ViewTypeTool
.
The ViewTypeTool
generates the VIEW_TYPE_CHANGED_EVENT
, which is defined in the oracle.dss.thin.BIConstants
interface.
The ViewTypeTool
handles the VIEW_TYPE_CHANGED_EVENT
by passing it to all registered ViewToolListener
objects.
When you use the ViewTypeTool
, you must handle the VIEW_TYPE_CHANGED_EVENT
in a listener. In the handleViewToolEvent
method, the listener should respond to the VIEW_TYPE_CHANGED_EVENT
by creating a new thin table, crosstab, or graph, if the VIEW_TYPE
parameter is not the same as the current view.
If the VIEW_TYPE
parameter is equal to ViewTypeTool.GRAPH
,
then you should also set the graph type of the graph. The GRAPH_TYPE
parameter and the GRAPH_SUBTYPE
parameter provide values that you
pass to the setTypeAndSubtype
method of the GraphTypeConverter
of the ThinGraph
.
Your listener might also want to retrieve information from the current view to use in the view that you create. For example, you might want to get the title text of the current view and set it on the view that you create. Or you might want to set the paging control to be displayed or hidden, to match the current view.
In the BI Beans servlet samples, "Sample 4: Working with the toolbar and a data view" includes a working listener for the view type tool.