Oracle Fusion Middleware Data Visualization Tools Tag Reference for Oracle ADF Faces 11g Release 1 (11.1.1.6.0) E12418-08 |
Specifies interactivity properties on subcomponents of a graph and gauge component. This function provides a connection between a specific subcomponent, and an HTML attribute or a javascript event. One common example is that users may use a bar of a graph or the indicator of a gauge to trigger a hyper-link action. Each shape attribute tag must contain a subcomponent and at least one attribute in order to be functional. Example: dvt:shapeAttributes component="component_A" onClick="#{backing_bean_B}"
In general, there are two types of attributes - behavior attributes and common attributes. All "behavior" attributes consist of a Javascript handler, and all of them have prefix "on" in their names. All other attributes are called "common" attributes.
Behavior Attributes - A behavior attribute, such as onClick, onMouseMove, onKeyDown etc, takes a string that contains javascript code or a reference to a backing bean method that returns javascript code, as its value. The browser will run the javascript code when a specific action occurs depending on which attribute. If the value is a backing bean method, the method takes the subcomponent handle as its input parameter, see the example code below:
Common Attributes - Some common attributes take a string or a backing bean method that returns a string as their values, namely alt, herf, noherf, target, title and tabindex. Examples:
Other common attributes control the basic settings of the interactivity. User can specify a subcomponent for the shape attribute by component attribute, the identifier of the subcomponent by id attribute, and the controls over the click events by clickable, clickAction and clickListener attributes.
The shapeAttributes tag is a child of the shapeAttributesSet tag.
The shapeAttributes tag has no child tags.
The following example shows XML for shapeAttributes tags associated with the gauge indicator and the gauge metric label.
<dvt:gauge > <dvt:shapeAttributesSet> <dvt:shapeAttributes component="GAUGE_INDICATOR" alt="#{sampleGauge.alt}" onClick="#{sampleGauge.onClick}"/> <dvt:shapeAttributes component="GAUGE_METRICLABEL" alt="#{sampleGauge.alt}" onMouseMove="#{sampleGauge.onMouseMove}"/> </dvt:shapeAttributesSet> </dvt:gauge>
In the backing bean (sampleGauge):
public String alt(oracle.dss.dataView.ComponentHandle handle) {
return handle.getName(); }
public String onClick(oracle.dss.dataView.ComponentHandle handle) {
return ("document.title=\"onClick\";"); }
public String onMouseMove(oracle.dss.dataView.ComponentHandle handle) {
return ("document.title=\"onMouseMove\";"); }
Alternatively, user may use a string as the value for the attributes (without using backing bean methods)
<dvt:gauge > <dvt:shapeAttributesSet> <dvt:shapeAttributes component="GAUGE_INDICATOR" alt="Indicator" onClick="document.title="onClick";"/> <dvt:shapeAttributes component="GAUGE_METRICLABEL" alt="MetricLabel" onMouseMove="document.title="onMouseMove";"/> </dvt:shapeAttributesSet> </dvt:gauge>
The following example shows how to use a clickListener. Example code in a JSPX page:
<dvt:areaGraph > <dvt:shapeAttributesSet> <dvt:shapeAttributes component="GRAPH_AREAMARKER" clickable="true" clickListener="#{sampleGraph.clickListener}"/> </dvt:shapeAttributesSet> </dvt:gauge>
Example code in the backing bean (sampleGraph):
public void clickListener(ClickEvent ce) {
System.out.println(ce.getComponentHandle().getComponentInfo().toString());
}
When the area marker is clicked, the debug window will print the component info, which is "series = XXX".
Another example for clickListener. The ClickEvent contains the information about the data point. Sample code:
public void processClick(ClickEvent event) {
ComponentHandle handle = event.getComponentHandle();
if(handle instanceof DataComponentHandle) {
DataComponentHandle dhandle = (DataComponentHandle)handle; System.out.println("value " + dhandle.getValue(DataComponentHandle.UNFORMATTED_VALUE));
System.out.println("row key " + dhandle.getValue(DataComponentHandle.ROW_KEY));
System.out.println("key path " + dhandle.getValue(DataComponentHandle.KEY_PATH));
Attributes[] seriesInfo = dhandle.getSeriesAttributes();
if(seriesInfo != null) {
for(Attributes attrs: seriesInfo) {
System.out.println("Series attribute value " + attrs.getValue(Attributes.LABEL_VALUE));
System.out.println("Series attribute name " + attrs.getValue(Attributes.LABEL_ATTRIBUTE));
System.out.println("Series attribute value id " + attrs.getValue(Attributes.ID_VALUE));
System.out.println("Series attribute name id " + attrs.getValue(Attributes.ID_ATTRIBUTE)); } }
Attributes [] groupInfo = dhandle.getGroupAttributes();
if(groupInfo != null) {
for(Attributes attrs: groupInfo) {
System.out.println("Group attribute value " + attrs.getValue(Attributes.LABEL_VALUE));
System.out.println("Group attribute name " + attrs.getValue(Attributes.LABEL_ATTRIBUTE)); } } }
//handle could be an instance of ScatterDataComponentHandle for scatter graphs,
//BubbleDataComponentHandle for bubble graphs and StockDataComponentHandle
//for stock graphs to fetch additional information
//handle could be an index of GroupComponentHandle if clicked on
//group component such as o1TickLabel
//handle could be an index of SeriesComponentHandle if clicked on
//series component such as legendText, legendTitle
}
}
}
}
}
Name | Type | Supports EL? | Description |
---|---|---|---|
id | java.lang.String | no | Specifies the identifier for the component |
component | java.lang.String | no | The subcomponents of an ADF component that can be designated as capable of interactivity. Valid values for graphs are:
Valid values for gauges are:
|
clickListener | java.lang.String | no | Refers to a backing bean method that takes a ClickEvent as an argument. The method will be process when the subcomponent is clicked. Only works in FLASH image formatted graph or gauge. |
clickAction | java.lang.String | no | A reference to backing bean action method that will be called when the subcomponent is clicked, or the static outcome of the action. Only works in FLASH image formatted graph or gauge. |
clickable | java.lang.String | no | A reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle and returns a boolean value indicating whether a ClickEvent should be fired when this subcomponent is clicked. This can also be a static value "true" or "false". Only works in FLASH image formatted graph or gauge. |
formatType | java.lang.String | no | Specifies whether a text component appears as a hyperlink or normal. Valid values are:
|
alt | java.lang.String | no |
Common AttributesIn the following section, (includes alt, href, tabindex, nohref, target, title) each attribute takes either a value or a reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle, which returns a value. The value can be a string, or a boolean depending on the attribute. The following attributes have the usage of the value listed. A reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle and returns String. This String is set as the alt text of the component, and will be displayed as a tooltip when a user hovers over the component. |
href | java.lang.String | no | A reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle and returns value of HREF HTML attribute. This creates a link to the href value on the component. |
tabindex | java.lang.String | no | The value is a string, which is the tabindex value. It represents the order of the focus on the component when tabbing through keyboard. |
nohref | java.lang.String | no | The value is a boolean, which indicates whether if NOHREF should be rendered for this component. If NOHREF is assigned true to this component, HREF will be disabled, otherwise HREF will be enabled. |
target | java.lang.String | no | The value is a string, which represents the TARGET HTML attribute. Target attribute specifies the where the web browser to open a hyperlink. Four pre-defined targets are _blank, _self, _parent, and _top. User can also specify a descriptive name with an underscore. |
title | java.lang.String | no | The value is a string, which represents the TITLE HTML attribute. The value of the title attribute annotates the component. |
onClick | java.lang.String | no |
Behavior AttributesIn the following section, all attributes are behavior attributes. Each attribute takes either a string or a reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle as its input argument, which returns a string. Either way, the string that returns is a piece of javascript code that get executed when the attribute is triggered. The following attributes have trigger conditions as listed. When the subcomponent gets clicked. |
onDblClick | java.lang.String | no | When the subcomponent gets double clicked. |
onFocus | java.lang.String | no | When the subcomponent gets the focus. Only works in PNG image formatted graph or gauge. |
onBlur | java.lang.String | no | When the subcomponent loses the focus. Only works in PNG image formatted graph or gauge. |
onKeyPress | java.lang.String | no | When the subcomponent has the focus and a keyboard key is pressed down and released. Only works in PNG image formatted graph or gauge. |
onKeyDown | java.lang.String | no | When the subcomponent has the focus and a keyboard key is pressed down. Only works in PNG image formatted graph or gauge. |
onKeyUp | java.lang.String | no | When the subcomponent has the focus and a keyboard key is released. Only works in PNG image formatted graph or gauge. |
onMouseMove | java.lang.String | no | When the mouse pointer gets over the subcomponent. |
onMouseOver | java.lang.String | no | When the mouse pointer moves away from the subcomponent. |
onMouseOut | java.lang.String | no | When the mouse pointer is moved inside the subcomponent. |
onMouseDown | java.lang.String | no | When a mouse button is pressed down inside the subcomponent. |
onMouseUp | java.lang.String | no | When a mouse button is released inside the subcomponent. |