XHTMLB
Specification
XHTMLB is XML based format for creating HTMLB documents using the XHTMLBTransformer. To creating XHTMLB documents you need knowledge of HTMLB.
Every node in XHTMLB is equivalent to an HTMLB component. Every attribute of an XHTMLB element is equivalent to a call of a set method, where the name of the attribute is the name of the method and the attribute value is the method parameter.
The text in the XML node is added to the component by using the method setText() or setValue(). If the current component is an HTMLB container, the method addText will be called. The last text node is used as the value.
Example of an XHTMLB node:
The following statement will create an HTMLB button component with the text My button and with the value MyEventValue that will be sent when clicking on the button (OnClick event).
<Button id="testButton" OnClick="MyEventValue">My button</Button>
<TextView Wrapping="true"> |
Declaring parameters has the following reasons:
· Calling a method on the current component that has a static input field value.
· Adding key/value pair to the current component (when needed).
To call a method that requests a static value from a class (like enumerated values), add the element named parameter with the following attributes:
· Name
The name of the method without the “set” or “add” prefix.
· class
The name of the class.
· package
The name of the package (default package name is com.sapportals.htmlb)
· value
The name of the static member that will be inserted to the method.
The following example generates an HTMLB TextView component. The method setDesign() will be called with com.sapportals.htmlb.enumTextViewDesign.LABEL class as parameter. The method setLayout() will be called with com.sapportals.htmlb.enumTextViewLayout.BLOCK class as parameter.
<TextView |
The key/value pair parameter is used for HTMLB components that have a slection list, like ListBox, DropDownListBox, ToolbarDropDownListBox and BreadCrumb.
<DropdownListBox id="Dropdown1" |
HTML tags will be added to the current HTMLB container. HTMLB components cannot be placed in HTML tags; once an HTML tag is defined all its children will be HTML elements as well.
In this example the HTML span tag and its children will be added to the HTMLB Group container.
<Group> |
XHTMLB table are created by using a TableView element with a JCOTableViewModel or DefaultTableViewModel. The models can have TableColumn elements and TableRow elements. TableRow elements are no HTMLB components and can have TableCell elements which are also no HTMLB components.
TableView ...> |
The TableView element can have all the set methods (XHTMLB attributes and parameter elements) like any other HTMLB element except the following:
· setModel
It is used to insert the TableViewModel by parameter. When the model attribute is set for a TableView element, the value must point to a parameter inserted to the XHTMLB transformer with an object inherited from TableViewModel.
· CellRenderer
XHTMLB supports self defined cell renderers. The cell render object must inherit from com.sap.portal.transformationservice.xhtmlb.IXHTMLBCellRenderer. If no cell renderer is defined, the data will be treated as raw data. The definition can be done by adding a parameter element to the TableView element with the class definition in the class and package attribute or with the name of the external property in the value attribute. Only one cell renderer can be defined for a table, the last one specified will be used. To use a self defined renderer the cell must have the attribute useRenderer="true".
Example:
<TableView id="TestTable" width="400"> |
· Row specific methods must be defined in the TableRow element.
· Cell specified methods must be defined in the TableCell element. The cell methods get the row index, cell index and a value to set.
A model can have no attributes and parameters.
Supports all the set methods of the HTMLB TableColumn component. Every table column must have an index (starting from 0) and a name. A TableColumn element has no child elements.
The TableRow element has no corresponding HTMLB component. It is used to wrap the content of a table row. It can receive all the methods related to rows. Row methods are:
· selectRow
· setOnRowSelection
· setRowSelectable
· setRowVAlignment.
The TableCell element has no corresponding HTMLB component. It holds the actual data of the cell and has all “set” methods attributes of the TableView component that refers to cells. These methods take row index, column index and value to set. Cell methods are:
· setCellDisabled
· setCellHAlignment
· setCellInvalid
· setCellType
· setCellVAlignment
· setColspanForCell
· setRowspanForCell
· setStyleForCell.
The Table Toolbar element must be declared before the starting the declaration of the TableView. The connection is done by assigning the Id to the toolbar element and adding the attribute toolbar="<toolbar element ID>" to the TableView element.
Following limitations apply to the TableView:
· Cells cannot have child elements. As a result, no HTMLB component can be a child of a table cell.
· All the table columns must be defined before the table rows.
· Sorting of columns is not supported by default.
Example using a GridLayout component.
Example using a TableView component.
Following components have a different behaviour:
· GridLayoutCell
All elements must have row and column attribute with an integer value starting at 1. See the GridLayout example for more details.
· Group
To define a group child element as header component, add the attribute isHeaderComponent = "true" to the child element.
· ItemList
Each component in the list can set its bullet image URL by adding the attribute bulletURI="<bullet URL>" and set the bullet style by adding the attribute style="<style parameters".
· TableView
TableView and its related components are defined completely different than in HTMLB. Refer to the TableView example for more details.
· TabStripItem
To set a TabStripItem child element as header component, add the attribute isHeader="true" to the child element. Other child elements will be inserted to the body of the TabStripItem by the order they are specified.
Following HTMLB components are not supported:
· MenuBar
· MenuItem
· Chart
· FormLayout
· DragSource
· DropTarget
· EventValidationComponent
· EventValidationContainer
· JavaScriptFragment
· PopupTrigger
· RoadMap
· RoadMapItem