About the Reference
Structure of the Description | Controls
This page describes the structure of the the Control API pages for the
HTMLB controls.
Structure of the Description
The description of the controls is structured in:
- General description - what is it
- Attributes of the control
- Overview of the attributes with possible values, defaults and the
manipulation with the JSP-taglib and classlib.
- Example
The values column in the overview table specifies which type of
parameter the attribute expects. This can be
- String
An ASCII string. Usually event handling routines, names, titles etc.
- Units
An integer value specified in web client units. According to the HTML
standard units can be specified in
- Pixel (px)
Pixels are the smallest addressable unit on the web client. A web
client has a maximum resolution, that is the number of horizontal
times vertical pixel (e.g. 800x600, 1024x768 etc.) When you specify
units in pixel you can make sure that your control is displayed
on every web client in the same size.
Pixel is the default unit.
Example
Both expressions set the width of a control to 500 pixel.
width="500"
width="500px"
- Percent (%)
The percentage specified is calculated from the visible space of
the web client. If e.g. a width of a control is specified with 50%
the control uses half of the of the web client width. The control
changes its width according to the web client dynamically (e.g.
if the web client window gets scaled).
Example
The width of a control is set to 30% of the web client.
width="30%"
- Numeric
A numeric expression.
- Others
If an attribute requires specific values. Booleans require "TRUE"
or "FALSE" or text size can only be "LARGE", "MEDIUM"
and "SMALL".
Top
Controls
General
To use the controls you have to know about the syntax and the attributes
of the controls. Every control has different attributes. In the description
we describe the attributes and gather the information in a table which
shows the usage with the taglib and the classlib.
Syntax
Programming with the JSP taglib follows the XML syntax. Each control
is "wrapped" in tags. To identify the tags as XML the prefix
- hbj: (stands for: HTML-Business for Java)
is used. Some controls (e.g. tray, group) also need a tag body. The tag
body specifies the controls that are placed "inside" the tag.
The syntax would be like:
Tag
<hbj:mycontrol comment: begin of tag for HTMLB control
attributes comment: setting of attributes of HTMLB control
</hbj:mycontrol> comment: end of tag for HTMLB control
Tag with "quick" end of tag (only possible when the
tag has no body)
<hbj:mycontrol comment: begin of tag for HTMLB controls
attributes comment: setting of attributes of HTMLB control
/> comment: end of tag for HTMLB controls
Tag with body
<hbj:mycontrol_withbody comment: begin of tag for HTMLB control
attributes comment: setting of attributes of HTMLB control
< comment: end of tag for HTMLB control
<hbj:a_control_in_the_body
attributes
/>
<hbj:next_control_in_the_body
attributes
/>
more controls
</hbj:mycontrol_withbody> comment: end of tag for HTMLB controls with body
|
Scriptlet
A scriptlet can contain any number of language statements, variable or
method declarations, or expressions that are valid in the page scripting
language.
Within a scriptlet, you can do any of the following:
- Declare variables or methods to use later in the file.
- Write expressions valid in the page scripting language.
- Use any of the implicit objects or any object declared with a <jsp:useBean>
element.
- Write any other statement valid in the scripting language used in
the JSP page (if you use the Java programming language, the statements
must conform to the Java Language Specification).
Any text, HTML tags, or JSP elements must be written outside the scriptlet.
Scriptlets are executed at request time, when the JSP container processes
the client request. If the scriptlet produces output, the output is stored
in the out object.
Certain attributes (if the column "JSP taglib" in the attribute
table to each control has no entry) can only be assigned using scriptlets.
The scriptlet has to be placed in the tag body of the HTMLB control. The
scriptlet starts with <% and ends with %>. The following
example uses the button control and sets some
attributes with a scriptlet.
<hbj:button
id="OrderConfirm"
width="100px"
tooltip="Click here to confirm order"
onClick="ProcessConfirm"
disabled="false"
design="STANDARD"
>
<% comment: start scriptlet in the tag body
OrderConfirm.setText("Confirm"); comment: set the text for the button
OrderConfirm.setWidth("125px"); comment: set "width" - this overrides
"w
idth" set in attribute section
%> comment: end of scriptlet
</hbj:button>
Result
|
Enumeration Values
In the classlib column some values have to be set as enumeration values.
In the classlib column you find the class name and the enum (separated
by a dot).
- Example
breadcrumb.setSize(BreadCrumbSize.MEDIUM)
For an executable program you have to add the location of the enum. That
is:
- com.sapportals.htmlb.enum.
So according to the example above you have to specify:
- Your program:
breadcrumb.setSize(com.sapportals.htmlb.enum.BreadCrumbSize.MEDIUM)
To save some typing when you enumeration values more often the package
can be imported:
- <%@ page import="com.sapportals.htmlb.enum.BreadCrumbSize,
..... " %>
Boolean Values
Taglib:
Boolean values are specified as string and can be lowercase and/or uppercase.
Classlib:
Boolean values are specified as boolean and have to be specified
only in lowercase characters.
Top
|