This document is intended to provide a comprehensive reference guide for Web developers using SAP xApp Manufacturing Integration and Intelligence (SAP xMII) Java applets in their Manufacturing Intelligence Portal™ applications.
There are a number of applets that provide a rich set of data display capabilities for a wide range of data sources. The applets are capable of a broad range of display modes, including a variety of business charts, an intelligent grid, indicator lights, a dynamic "scoreboard", a real-time ticker, and intelligent tree/list box controls. An additional utility component provides a calendar applet that can be used to provide customized date selection within a Web page.
These applets provide a visual front-end to the wide-ranging server-side connector architecture that SAP xMII provides. Through a variety of techniques, the applets are "dynamically bound" to data streams from the connectors, providing current, historical, statistical, and other views of the broad range of plant and production data sources found in a typical manufacturing enterprise.
This section describes some general information regarding the correct usage of the SAP xMII Java applets. The applets themselves are automatically downloaded from the Web server to the Web browser, and the display code and user interaction occurs within the browser. The applets will request data from the Web server when needed. Obviously, a Java capable browser must be utilized to leverage the capabilities of these Java applets. However, non-Java browsers and microbrowsers such as those provided on the Palm and Windows CE platforms can also leverage SAP xMII's applets indirectly by having the charting performed on the server-side instead of the client side or by having HTML tables generated as an alternative to the iGrid object. Refer to the Customizing Output documentation for detailed instructions on how to use server-generated content in your browser.
Each of the SAP xMII applets consists of two components - a query object and a display object. The query object is responsible for connecting to the SAP xMII server and processing the request for and handling the receipt of data. It then hands this data to the display object to draw/render the visual content for the user. All communications between the applets and the SAP xMII server/servlets is via standard HTTP requests. This approach ensures maximum compatibility with network infrastructures and avoids complicated firewall configuration issues. It also allows security to be implemented in a highly integrated manner with the Web server's security model.
The simplest and easiest way to use the SAP xMII applets is through the use of XML templates to define the "query" and "display" behaviors for a given instance of a Java applet. The Template Editor Reference describes how to use the editor to create each of the various types of templates that are supported. To utilize these "building blocks" in your Web pages, simply include the appropriate PARAM tags for the DisplayTemplate and QueryTemplate parameters in your Web page. Thus, in the simplest form, an SAP xMII applet can be implemented with four simple lines of HTML code as in:
|
<APPLET NAME="TrendChart" CODEBASE="/Illuminator/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="800" HEIGHT="400" MAYSCRIPT> <PARAM NAME="QueryTemplate" VALUE="FillingArea/SampleQuery"> <PARAM NAME="DisplayTemplate" VALUE="FillingArea/SampleChart"> </APPLET> |
There are also various system defaults that control the default behavior of the applets. The SAP xMII XML templates located in the DEFAULTS folder provide default values to be used if a DisplayTemplate or QueryTemplate parameter is not specified in the HTML code for a given applet. If either of these parameters are specified, values for query and appearance parameters will be loaded from your user-defined XML template. Finally, any PARAM tags included in the HTML code will override both the default values and the values in a query or display template. Thus, PARAM tags have the highest priority, followed by values in Query and Display Templates, followed by Default Templates.
Once the applets are loaded and their properties/parameters have been retrieved, the applet queries the appropriate connector on the Web server and the data is displayed for the user. Many of the SAP xMII applets are highly interactive, allowing the user to scroll time intervals and axis ranges, to dynamically select data points, to control the visual appearance, to load/save templates, and to view additional data associated with the current view, such as detailed data values, statistics, or current values. The application designer can selectively enable or disable much of this functionality on a per-applet basis.
The applets can be set to refresh "on demand" or to automatically refresh at a given time interval. For maximum system scalability, "client pull" is used rather than keeping connections open to the Web server, which can create performance obstacles. The SAP xMII server engine automatically implements significant performance optimization by managing database connections, bandwidth usage, and caching wherever practical.
You can, of course, include multiple Java applets on the same page, and it is common to use techniques such as HTML tables to assist with layout and formatting of Web content when multiple objects need to be aligned and organized on a page. Remember to take into account the possibility that not all of your users will be running the same type of browser, with the same display resolution, and same font sets.
By combining multiple SAP xMII applets with simple Web page scripting, powerful "drill down" or "data correlation" applications can quickly be developed. The applets provide several selection and click events that can be used to call your Web page scripts, to change the filter expression of another applet's query object for example, based on the data contained in the first applet selection.
It is also worthwhile to note that one need not use query or display templates at all. The SAP xMII applets can be configured exclusively with PARAM tags within the APPLET tag, if so desired. Our usability testing has indicated that a combination of templates and Web-page-specific parameter values seems to provide the optimal combination. For example, you can create a TagQuery template that includes references to a connector, server and tag names and perhaps has the Mode parameter set to "Current". If you wanted to use this template in an iChart object to display a historical trend, you would include a reference to the template in the QueryTemplate parameter and include a PARAM tag to set the Mode parameter to "History" or "HistoryEvent". Remember, the PARAM tag always overrides the defaults. You may also override any parameter through user interaction by setting a PARAM tag to a new value in Web script and calling for an applet to update.
Java applets are embedded into HTML pages using the APPLET or OBJECT HTML tags. The APPLET tag also includes attributes to specify the size of the applet (height and width), a name for the applet (which can be used when manipulating applets via Web page scripting such as JavaScript or VBScript), as well as important attributes that instruct the Web browser where to look for the compiled Java code to be loaded (the CODE attribute, which specifies the class filename, the CODEBASE attribute, which specifies the path to the archive file, and the ARCHIVE attribute, which specifies the archive file or files). In the case of SAP xMII, this code is contained in what is called an archive file, which optimizes download times by packaging all of the SAP xMII client-side Java classes into a compressed ZIP file. Inside of the APPLET tag, PARAM tags may be used to pass parameters to the applet that control or affect its behavior or appearance. Later sections in this document provide extensive detailed information on the supported parameters for each applet.
To utilize an SAP xMII applet in your Web pages, you would include the appropriate applet tags as follows. It should be noted that many page authoring tools will automatically insert much of this HTML code when you insert an applet into a Web page. In addition, SAP xMII has a Template Editor Utility and a Page Generator Utility that automatically create the necessary syntax. For the highest level of productivity, try using the SAP xMII Wizard or the SAP xMII Front Page Add-In.
|
<APPLET NAME="TrendChart" CODEBASE="/Illuminator/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="800" HEIGHT="400" MAYSCRIPT> <PARAM NAME="QueryTemplate" VALUE="FillingArea/SampleQuery"> <PARAM NAME="DisplayTemplate" VALUE="FillingArea/SampleChart"> <PARAM NAME="ShowTagDescription" VALUE="true"> <PARAM NAME="RefreshRate" VALUE="1"> </APPLET> |
Besides the PARAM tags, which are specific to a particular applet and/or data source, the only attribute that is different between the various applets is the CODE attribute, which would refer to the appropriate component that you wish to embed. The use of the MAYSCRIPT attribute, as shown above, is only required when you will be manipulating the applet via Web page scripting or will be triggering Web page scripting from an applet event such as clicking on the chart legend or a grid row.
An automatic Web page generation utility is provided, and is an excellent way to get started. Please refer to the Using the Page Generator section of the Getting Started help topic.
Web page or browser-based scripting can be used to dynamically control the behavior and appearance of the SAP xMII applets, and can also be associated with applet events such as user selections to link applets together for drill-down or data correlation applications. The most common and most widely supported Web page scripting language is JavaScript (aka ECMA script), and all the samples will be shown using this scripting language. However, in the Microsoft-only world, VBScript can also be used to manipulate the SAP xMII applets using very similar techniques.
In general, any of the applet properties can be changed, and any applet methods can be called, via scripting. In order to manipulate an object on a Web page, it must be given a unique name using the NAME attribute of the APPLET HTML tag. Microsoft Internet Explorer and Netscape Navigator provide an object model by which an applet can be accessed using the syntax "document.appletName", where appletName is the value of the "NAME" applet parameter. While this document won't attempt to teach you Java scripting and building HTML forms, it will explain how to utilize the SAP xMII applets via scripting. You can also look at the provided sample Web pages that illustrate some of these techniques. Additionally, if you plan to have the Web page scripts respond to applet events such as clicking on a chart legend or clicking on a row in a grid object, you'll need to include the MAYSCRIPT attribute in the APPLET HTML tag. The parameter reference includes a section on configuring selection events. The following HTML snippet shows the use of the NAME and MAYSCRIPT attributes.
|
<APPLET NAME="FillerPerformanceChart" CODEBASE="/Illuminator/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="800" HEIGHT="400" MAYSCRIPT> <PARAM NAME="QueryTemplate" VALUE="FillingArea/SampleQuery"> <PARAM NAME="DisplayTemplate" VALUE="FillingArea/SampleChart"> <PARAM NAME="SelectionEvent" VALUE="FillerParameterClicked"> </APPLET> |
In this case, the applet "name" is FillerPerformanceChart. Note that, in general, JavaScript is case-sensitive, so exercise care when authoring script and referring to Web page objects.
The syntax for getting or setting a property is almost identical to its parameter name. SAP xMII uses a concept called "design patterns" to provide a consistent means for accessing properties. For most parameters, prefixing the word "get" or "set" to the parameter name provides the means for accessing/changing the parameter value. To retrieve a specific applet attribute, use the get method. Values may be set to a specific value via the set method. The only exception to this rule is for boolean data types. To get a boolean return, you must use an "is" method followed by the attribute name. Boolean attributes still use the "set" method.
For example, reading the refresh interval (applet parameter name is RefreshRate) is done by calling:
|
currentRefreshRate = document.appletName.getRefreshRate(); |
...whereas writing the refresh interval is done by calling:
|
document.appletName.setRefreshRate(60); |
A slightly different "design pattern" is used for boolean properties. For example, a boolean applet property, such as AutoRefresh, would be read using:
|
currentAutoRefresh = document.appletName.isAutoRefresh(); |
... whereas writing the value is done by calling:
|
document.appletName.setAutoRefresh(true); |
The only other exceptions to this rule are what could be described as "indexed" properties. An example would be setting a tag name in a query object or setting the min/max scaling ranges in a chart. In these cases, the get/set or is/set methods require an additional parameter corresponding to the "index" of the item to be read/written. In general, SAP xMII indexed properties are "one-based,"(i.e., the first item has in index of one). For example, to set the first three tags in a chart object, the following script could be used:
document.TrendChart.getQueryObject().setTagName(1,"ReactorLevel"); document.TrendChart.getQueryObject().setTagName(2,"ReactorTemperature"); document.TrendChart.getQueryObject().setTagName(3,"ReactorPressure");
Or, to synchronize scaling between three tags, the following script could be used:
var minRange,maxRange; minRange = document.TrendChart.getChartObject().getMinRange(1); maxRange = document.TrendChart.getChartObject().getMaxRange(2);
Note that the above examples reference the applet and the applet's display object or the applet's query object. Many of the parameters are associated with the query or with the display object. The distinction is described in the SAP xMII Applets and Contained Objects section.
In general, every parameter that can be configured in a template or specified as an applet parameter in an HTML page can also be manipulated via Web page scripting. The following sections of this document describe how to access the various objects, properties, methods, and events in detail. For specific applet parameters and their functional meaning, refer to the specific applet reference. A list of Common Display Object Methods can be found below. Also, refer to the Query Parameter Reference Guide for query object specific parameters.
Calling a method is also as simple as referencing the object and calling the appropriate function with any necessary parameters. For example, calling the refresh() method is done using:
document.appletName.refresh();
The following example might be used to load a new query template dynamically. The script first checks to see if the same template is already loaded using the "getQueryTemplate" property access method, and if it is not, sets the query template and title properties, then calls another method to refresh the trend.
function btnLoadQueryTemplate_OnClick(templateName) { if(document.Trend1.getQueryTemplate() != templateName) { document.Trend1.setQueryTemplate(templateName); document.Trend1.refresh(); } }
In fact, accessing properties/parameters of an applet is simply a special case of calling applet methods. Property accessors are nothing more than methods with a specific "design pattern".
Each of the SAP xMII applets is actually a container for other Java objects. The applets consists of two basic objects: One is a query object that handles the mechanics of submitting a request for data values and processing the results, and the second is a display object responsible for handling drawing the on-screen representation of the data and handling user interactions.
Some properties and methods are associated with the applet, however, most are associated with the underlying query object and display object.
The query object for an applet is accessible via the getQueryObject() method. The display object is accessed using an applet-specific method, such as getChartObject(), getGridObject(), getTickerObject(), or getBrowserObject(). The properties exposed by the query object are dependent on the type of query - TagQuery, SQLQuery, AlarmQuery, or TemplateQuery. There are a number of common query properties, as well as a number of type-specific properties. The common properties are described below. Type-specific properties are described in the individual applet documentation and in the Query Parameter Reference Guide. The type of query can also be obtained by calling the getQueryType() method on the query object.
As an example of manipulating a query object via scripting, changing the filter expression for a SQLQuery object included in an iChart object would be accomplished via:
document.QualityChart.getQueryObject().setFilterExpr("SampleID = 'pHReading'");
In this example, the value in column four (4) of the currently selected row in an iGrid object will be changed.
selectedBatch = document.ActiveBatchGrid.getGridObject().getSelectedCellValue(4);
The applet itself can also expose "top level" methods and properties, as in the following example which loads a new query template into an iBrowser object:
document.LotList.setQueryTemplate("Tracking/RawMaterialLotQuery");
In summary, each SAP xMII applet provides a wrapper around a display object and a query object. Not surprisingly, the XML templates used within SAP xMII correspond directly to the display and query object properties and provide a means for "componentizing" reusable sets of property values.
These small examples show the flexibility that application developers have been provided to manipulate the Java applets provided by SAP xMII. You will truly be limited only by your imagination! Go ahead and experiment...you can't hurt anything!
The data types used in the applets include date/time, boolean, string, integer, color, and floating point values. The following describes the appropriate format for each of these data types. While not all parameter values need the enclosing "double quotes", it is good practice to do so particularly for String data types, and is required whenever spaces or special characters are part of the value.
|
Data Type |
Valid Values |
Sample Entry |
|
Date/time |
A string value that is dependent on any associated DateFormat parameter, however, the default date/time format is MM/dd/yyyy HH:mm:ss |
StartDate="11/11/1998 10:30:00" |
|
Boolean |
true, T, Y, yes, 1, false, F, N, no, 0 |
AutoRefresh="false" |
|
String |
ASCII characters |
TagName.4="ReactorTemp" XAxisDateFormat="MM/dd" |
|
Integer |
Numeric values with no decimal point |
MaxItems="500" |
|
Color |
Predefined color constants or long integer corresponding to an RGB value. Predefined constants include: black lightGray |
Colors can be specified using any of three techniques. The first is limited to the color names shown in the list to the left. The second is consistent with color specifications in HTML pages, and the third is a variant of this with the value being expressed as an integer value. Format #1 - Specify by Name: PenColor.1="red" Format #2 - Specify a hex RGB value: BackgroundColor="#FF00CC" Format #3 - Specify an integer RGB value: TitleColor="255" |
|
Floating Point |
Numeric values with or without a decimal point |
MinRange.5="-5" MaxRange.5="105.0" |
This section lists the applet parameters that are common to all of the SAP xMII applets.
|
Parameter Name |
Data Type |
Default Value |
Comments |
|
DisplayTemplate |
String |
None |
This parameter is used to provide a path to an XML display template from which parameter values for the applet or chart are to be loaded. This path is always relative to the /Illuminator/Templates directory. An example would be:
In this case, the template named "MyTemplate" is located in the "MyFolder" directory off of the /Illuminator/Templates directory. |
|
QueryTemplate |
String |
None |
This parameter is used to provide a path to an XML query template from which parameter values for a data query are to be loaded. This path is always relative to the /Illuminator/Templates directory. An example would be:
In this case, the template named "MyQuery" is located in the "MyFolder" directory off of the /Illuminator/Templates directory. |
|
AutoRefresh |
Boolean |
false |
This parameter enables or disables automatic refresh. If this value is true, and the refresh rate is non-zero, the applet will request data at (approximately) the user-specified refresh interval. AutoRefresh can also be dynamically turned on and off using the "light bulb" button on the TimeControl of the iGrid and iChart objects. |
|
RefreshRate |
Integer |
60 |
This parameter determines the automatic refresh interval (in seconds) and is used in conjunction with the AutoRefresh parameters. |
|
InitialUpdate |
Boolean |
true |
The InitialUpdate parameter tells the applet if it should get its data on load. The default value is true. An example of when this parameter can be used is when you have a grid whose query is dependent on one or more selections to be made on a page. By setting this parameter to false, the query will not be run until you tell the grid to update. This parameter only applies to the first update of the applet. |
The applet fonts are controlled via three parameters per font. Those include the font name, size, and style. When using the template editors, these parameters are editable in a WYSIWYG mode. When assigning them manually via applet parameters or name/value pairs in a URL, there are rules as to the range of values for these properties. The font name is one from the following list:
SansSerif
Monospaced
TimesRoman
Helvetica
Courier
Serif
Dialog
DialogInput
ZapfDingbats
The font style is an integer parameter that utilizes the following style constants:
0 : Plain
1 : Bold
2 : Italic
You may combine these style by adding the values together (e.g. Bold Italic = 3) when assigning a property value. Finally the font size is expressed as an integer "point size". Not all fonts are infinitely scalable.
When using the Template editors, colors can be selected interactively, either from a predefined palette or via an RGB color mixer. When specifying color as applet parameters or in a URL, colors can be specified using any of three techniques. The first is limited to the color names shown in the list to the left. The second is consistent with color specifications in HTML pages, and the third is a variant of this with the value being expressed as an integer value.
Format #1 - Specify by Name:
PenColor.1="red"
Format #2 - Specify a hex RGB value:
BackgroundColor="#FF00CC"
Format #3 - Specify an integer RGB value:
TitleColor="255"
SAP xMII is capable of supporting an infinite number of colors, however, most browsers and graphics cards have a practical limitations on the number of simultaneous colors that can be displayed.
This section describes the exposed methods or functions that are available with all of the applets and/or their contained display and query objects. These functions can be called from Web page scripting.
The following list of methods are accessible from any of the applets. They would be referenced using a syntax similar to:
document.appletName.method().
DataQuery getQueryObject()
This method is used to obtain a reference to the underlying query object that is supplying data to the applet. Once a reference has been obtained, its properties can then be manipulated. The reference for the query properties can be found in the SAP xMII Query Parameters reference.
void refresh()
This method is used to update the query to the current time and redraw the applet.
void setPropertyValue(String propertyName, String newValue)
This method is used to set a named value that can be accessed by any applet loaded by the user for the duration of the browser session. Once the browser is closed, these values are no longer available. This can be used to create "sticky" properties that can be passed between Web pages. For example, selecting a batch on one Web page might popup a new Web page with a detailed list of the materials consumed in the batch production. The batch number could be placed into a session parameter in the main page and picked up by the popup page. These properties can also be used to pass values to SAP xMII reports.
String getPropertyValue(String propertyName)
This method is used to get a named value that has been previously set using the setPropertyValue method. These values can then be used to set applet properties or whatever other application usage you might find valuable.
void showDetail()
This method is used to pop up an HTML page containing a tabular view of the raw data associated with the current applet.
void showHelp()
This method is used to display the applet user's guide.
void saveAsCSVFile()
This method is used to initiate a transfer of the raw data associated with the current chart to a local CSV file. The user will be prompted for the name of the file to be saved.
void showXMLDetail()
This method is used to pop up an HTML page containing an XML view of the raw data associated with the current applet.
void showDetailUsingGet()
This method is used to pop up an HTML page containing a tabular view of the raw data associated with the current applet using an html get.
String saveImage()
This method is used to get the URL reference to the GIF representation of the image being displayed by the current applet, and is only supported by the iGrid, iChart, and iSPCChart.
void showStatistics()
This method is used to pop up an HTML page containing statistical metrics associated with the current chart. This is only available when the underlying query is from a Tag connector.
void showCurrent()
This method is used to pop up an HTML page containing current value readings associated with the current chart. This is only available when the underlying query is from a Tag connector.
boolean getSelectionEventEnabled()
void setSelectionEventEnabled(boolean newValue)
These methods are used to get/set the property that enables firing of a selection event on an applet. This is useful when it is desired to enable/suppress this event dynamically via Web page scripting.
boolean getUpdateEventEnabled()
void setUpdateEventEnabled(boolean newValue)
These methods are used to get/set the property that enables firing of an update event on an applet. This is useful when it is desired to enable/suppress this event dynamically via Web page scripting. A common use for this is when synchronizing the scrolling of multiple applets.
void saveDisplayTemplate(String strDisplayFileName)
This method is used to save the current chart display properties to a specified XML Display Template file name. Do not include the XML extension in the file name parameter. Also remember that all file paths are relative to the \Illuminator\Templates directory, and forward slashes should be used as directory path delimiters.
void saveQueryTemplate(String strQueryFileName)
This method is used to save the current query properties to a specified XML Query Template file name. Do not include the XML extension in the file name parameter. Also remember that all file paths are relative to the \Illuminator\Templates directory, and forward slashes should be used as directory path delimiters.
Object createColor(String strColor)
This method is a utility function that can be used to control colors at runtime more easily. The value of the strColor parameter can be a color name (blue, red, green) or an HTML color string in the format #RRGGBB. The returned Color object can then be assigned to a color property in an applet.
String colorToString(Color cColor)
This method is a utility function that can be used to control colors at runtime more easily. A color property of an applet property can be converted to a string and used in HTML.
String encodeURLItem(String strItem)
This method takes a string as an input and URL encodes it so that it may be passed over the URL command line. The returned string has spaces, and other non-recognized attributes replaced with URL codes.
String formatDate(String strDate, String fromFormat, String toFormat)
This method is a utility function that can be used to reformat date/time strings. The parameters include the incoming date/time string, the incoming format (so that the string can be properly parsed), and the outgoing format. The resultant date/time string is returned.
String formatNumber(double dValue, String sFormat)
This returns a string for the value in the specified format.
String getUserName()
This method returns the name of the currently logged in user.
String xmlEncode(String strIn)
This method encodes a string such as <Test>Hello World</Test> to <Test>Hello World</Test>
String xmlDecode(String strIn)
This method decodes a string such as <Test>Hello World</Test> to <Test>Hello World</Test>
String xmlEncodeName(String strIn)
This method encodes a string such as 1Hello W@r!d to _1Hello_W_r!d
String stringReplace(String sSource, String sFind, String sReplace)
This method does a string search and replace and returns the updated string.
Double dateDiff(String sDate1, String sDate2)
This method takes two xml formatted date strings and returns the difference between them in seconds. Note: a negative number indicates that sDate2 is before sDate1.
Double dateDiffFormatted(String sDate1, String sDate2, String sFormat)
This method takes two date strings in the provided format string and returns the difference between them in seconds. Note: a negative number indicates that sDate2 is before sDate1.
String dateAdd(String sourceDate, String dateFormat, String sUnits, int nUnits)
This method takes the date string along with its corresponding format and adds the desired units (a negative nUnits number does the equivalent of a date subtraction). Please refer to the Duration parameter in the Common Query Parameters reference for available units.
Double dateToSeconds(String sDate1)
This method takes an xml formatted date and converts it to seconds.
Double dateToSecondsFormatted(String sDate1, String sFormat)
This method takes an date in the user defined format and converts it to seconds.
String dateFromSeconds(double dSeconds)
This method takes seconds and returns the corresponding date in xml format.
String dateFromSecondsFormatted(double dSeconds, String sFormat)
This method takes seconds and returns the corresponding date in the desired format.
String dateNow()
This method returns the current datetime in xml format, such as "2004-09-23T08:30:00".
String dateNowFormatted(String sFormatTo)
This method returns the current datetime in the requested format such as "MM/dd/yyyy HH:mm:ss" would return "09/23/2004 08:30:00".
String dateToXMLFormat(String sDate1, String sFormatFrom)
This method takes the date string, along with the corresponding format, and converts it to the xml date format.
String dateFromXMLFormat(String sDate1, String sFormatTo)
This method takes the xml formatted date string, and converts it to the desired format.
The following list of methods are accessible from any of the applet's contained display objects. They would be referenced using a syntax appropriate for each type of applet such as document.appletName.getGridObject().method() or document.appletName.getChartObject().method().
void updateDateToCurrentTime()
This method only applies to query templates that are time sensitive, and updates the dates for the query to the most recent time duration.
The iChart, iGrid, iBrowser, iCalendar, and iTicker objects support the ability to link a JavaScript function to a selection event. This provides an extremely powerful ability to link/correlate/drill-down between various objects on a Web page. Often, these objects will be linked to disparate data sources, enabling these relationships to be transparent to the end user. Very few, if any, of the canned "decision support" or "data mining" tools can match this type of functionality.
For specific event support, and for custom events specific to an applet type, refer to the appropriate applet sections of this guide. In particular, the iGrid, iChart, and iSPCChart support custom events that are specific to the applet's functionality.
|
Parameter Name |
Data Type |
Default Value |
Comments |
|
CreationEvent |
String |
None |
This parameter is used to provide the name of a JavaScript function in a Web page that will be called whenever the applet is first loaded into the Web page. |
|
FirstUpdateEvent |
String |
None |
This is similar to the UpdateEvent below, except that it is only called once each time an applet is initialized on a page. |
|
UpdateEvent |
String |
None |
This parameter is used to provide the name of a JavaScript function in a Web page that will be called whenever the applet's contents are updated following a query to the underlying data source. |
|
SelectionEvent |
String |
None |
This parameter is used to provide the name of a JavaScript function in a Web page that will be called whenever the user selects an item in the applet. |
|
DoubleClickEvent |
String |
None |
This parameter is used to provide the name of a JavaScript function in a Web page that will be called whenever the user double-clicks an item in the applet. |
In addition to the above events, the iChart applet has a ChartSelectionEvent and a ChartDoubleClickEvent. The iSPCChart applet has an UpperChartSelectionEvent, an UpperChartDoubleClickEvent, a LowerChartSelectionEvent, and a LowerChartDoubleClickEvent. The iGrid has a ColumnSelectionEvent, a GridScrollEvent, and a CellSelectionEvent. Please refer to specific applet reference guides for more information.
As mentioned in the section describing general applet usage in a Web page, the MAYSCRIPT attribute must be included in the APPLET HTML tag when using this event notification mechanism. When using the SAP xMII wizards for inserting HTML content, this attribute will automatically be included for you. The following is an example of how to specify the name of the JavaScript function to be called when an event is fired:
<APPLET Name="MyApplet" CODE="iChart" ... MAYSCRIPT> <PARAM NAME="SelectionEvent" VALUE="MyApplet_Selected"> </APPLET>
<SCRIPT LANGUAGE="JavaScript"> function MyApplet_Selected() { alert("Legend Clicked"); } </SCRIPT>
This event will be fired when an applet is first created in a Web page. Note that this does not guarantee that other applets on the same Web page will have been initialized. This is useful for configuring initial properties/behaviors for an applet via Web page scripting.
This event will be fired the first time an applet is initiated in a Web page. Not all browsers will necessarily support this capability, however, recent versions of Netscape and Microsoft drivers both support this feature.
This event will be fired each time an applet is updated in a Web page (including the first time the applet is initialized). This is very useful for taking actions whenever new data has been received or whenever the time period has changed. An example might be updating/synchronizing multiple charts whenever the "main" chart's time period is changed. Avoid creating "circular links" between applets that constantly update each other. The setUpdateEventEnabled method can be used to enable/suppress firing of this event dynamically.
In the case of the iChart object, this corresponds to selecting an item in the chart legend. For the iGrid object, it corresponds to clicking on a row in the grid. For the iBrowser object it corresponds to clicking an item in a tree or list. For the iCalendar object, it corresponds to clicking on a date (note: to change a time selection, set the time then re-click on the selected date to fire the event). The setSelectionEventEnabled method can be used to enable/suppress firing of this event dynamically.
This event will be fired when a user double-clicks the input device (mouse) on appropriate items in the applet. In the case of the iChart object, this corresponds to double clicking an item in the chart legend. For the iGrid object, it corresponds to double clicking on a cell or row in the grid. For the iBrowser object it corresponds to double clicking an item in a tree or list.
Refer to the SAP xMII Query Parameter Reference for a detailed discussion of the various parameters supported by each type of connector, and to the individual connector references for implementation-specific usage of these parameters. This section will address focus on the methods that all query objects support.
String buildURL()
This method is used to obtain the first part of the URL that is used to communicate from the applet to the Web server. It is convenient if attempting to build dynamic URL's in a Web page to open new browser windows with the results of data queries. Typically, this will return a string in the form:
http://<servername>/Lighthammer/Illuminator?
Of course, the <servername> would be replaced with the name of the Web server from which the applet was loaded.
String buildPostData()
This method is used to obtain the parameter part of the URL that is used to communicate from the applet to the Web server. It is convenient if attempting to build dynamic URL's in a Web page to open new browser windows with the results of data queries. Typically, this will return a string in the form:
Server=XYZ&Mode=???...
The actual list of parameters would depend on the type of connector/query and the mode.