分类:
2008-06-19 14:52:38
Use this BSP to define a framework around an internal element. You can switch the visibility of the internal element using an expand symbol in the element's header.
The tray element is similar to the group element, although it offers additional functionality. In its 'compressed' status, it is displayed as a narrow horizontal bar with a title and an expand symbol in the upper right hand corner. If you click on this symbol, the contents of the element is expanded and is therefore visible. This status is known as 'expanded'. When you click again on the symbol, the element returns to its compressed status.
Since the content of the element can be any embedded element, a tray can be very useful if you want to include a lot of information in a small space. Note, however, thattrays increase the complexity of your page and therefore decrease their usability.
The element triggers two different events for expaning and collapsing the body element, onExpand and onCollapse.
The tray element is an element with a very complex optical screen. It offers three different designs that are optimized for the most common applications.
The inner element structure consists of a element.
Name | Mandatory | Description |
---|---|---|
id | x | Unique name that clearly identifies the BSP element. This attribute is used in event handling and in data handling. |
title | Use this attribute to determine the title for the tray. | |
tooltip | Use this attribute to determine the quick info text that is displayed when the user moves the cursor over the tray. | |
width | Use this attribute to determine the width of the tray. | |
design | Use this attribute to determine the current design for rendering the tray. Possible values are BORDER (default value), BORDERLESS, FORM and TEXT. | |
onCollapse | Use this attribute to define the event handler that is called when the tray content is not visible. | |
isCollapsed | Use this attribute to determine the initial, collapsed status of the tray. | |
onExpand | Use this attribute to define an event handler that is called when the content of the tray is visible. | |
onEdit | Use this attribute to define an event handler that is called when the user clicks on the edit symbol in the header bar. | |
onRemove | Use this attribute to define an event handler that is called when the user clicks on the delete symbol in the header bar. |
Note
See also BSP application SBSPEXT_HTMLB, page tray.bsp
A BSP element can have several events. The BSP element tray has four event handlers, onCollapse, onExpand, onEdit and onRemove.
You usually implement your user interface elements using a element in the layout of your BSP, which points to the same page. In this default case, you generate the coding for the event handling in the OnInputProcessing section. Within the OnInputProcessing event handler, events can be recognized and assessed by the HTMLB BSP extension using the Event ID variable. For all HTMLB events, this variable has the value CL_HTMLB_MANAGER=>event_id. Events are usually handled according to this framework:
IF event_id = CL_HTMLB_MANAGER=>event_id.You can implement event handling in two ways. The first way involves retrieving the event data and then processing the data (usually in a large case statement). The alternative is to 'trigger' the event against an event class that was instantiated by the user.
If you want to read the status of a tray, this happens in the event handling phase in OnInputProcessing. The event handler OnInputProcessing could look as follows, for example:
DATA: tray TYPE REF TO CL_HTMLB_TRAY.Ensure that all recovered data for an element is expressly written to the element class. With the tray element, class CL_HTMLB_TRAY is used for this. The HTMLB manager returns an instance of this class.
The following attributes are recovered or set:
You can find additional information about BSP extensions in the SAP Library under .
You can find general information about BSP applications in the SAP Library under mySAP Technology Components -> SAP Web Application Server -> Web Applications (BC-MAS) -> SAP Web Application Server -> .