The Common-Controls Tag Library

<forms:form>

The tag generates a form. The form elements are specified in the tag-body.
../images/images/formform_small.gif

Body content: JSP
Tag class: FormTag
Tei class: FormTei
 

[ Syntax ]

Standard Syntax
<forms:form
formid = "String"
type = "{search | create | display | edit | header | info}"
[ action = "String" ]
[ caption = "String" ]
[ cellWidth = "String" ]
[ detail = "String" ]
[ help = "String" ]
[ hideButtons = "String list" ]
[ id = "String" ]
[ imagemap = "String" ]
[ labelPrefix = "String" ]
[ labelSuffix = "String" ]
[ labelWidth = "String" ]
[ locale = "String" ]
[ method = "{get | post}" ]
[ name = "String" ]
[ noframe = "Boolean" ]
[ permission = "ACL" ]
[ property = "String" ]
[ scope = "{any | page | request | session | application}" ]
[ style = "String" ]
[ styleClass = "String" ]
[ summary = "String" ]
[ transaction = "Boolean" ]
[ width = "String" ]
>
...Body Content...

</forms:form>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
actionString Specifies the Struts Action that is to be called in case of control element events.

This attribute need not be specified if the tag is included within a Struts <html:form> tag. In that case, the name of the action is determined using the Struts Form Bean.

Annotation: The action must be declared in one of the struts-config.xml files.

 
captionString The main title of the form.

The title and detail can also be specified together in the form "title - detail.

 
cellWidthString Specifies the width for the control.

Annotation: See HTML documentation for the attribute width.

 
detailString The detail title of the form.  
formidString The unique identification of the form. It is written in the form as a hidden field with the name formid and is thus available at the time of a form submission. The framework can call the corresponding EventHandler via the formid.
helpString Allows to assign a help id for the element. If set, a help symbol will be displayed beside the element, which will generate an onHelp event if the icon is clicked. The id can be used to display a special page of the help system. The help system is not part of the Common-Controls Framework.

To generate the hyperlink some default framework resources where used:
Resource KeyDescriptionDefault
fw.help.onclickAn optional onclick script handler. The handler can include a {0} placeholder for the help id-
fw.help.targetSpecifies the target where to open the hyperlink_blank
fw.help.tooltipA tooltip for the hyperlinkcontext help

Annotation: A jump screen of the Help system must be specified.

 
hideButtonsString list This attribute can be used to hide some of the buttons. The buttons needs to be specified within a semicolon separated list.

Annotation: A semicolon separated list. The button names must match values of ControlButton.getName()

 
idString The name of a page scope JSP bean that will contain the current element. Using the given Id, the variable can be accessed in scripting expressions in the tag Body. The id mus be a string lteral because the JSP compiler generates a variable withthis name at compile time

Annotation: A valid Java identifier must be given.

 
imagemapString Specifies the name of an Imagemap which must be saved in the request. The values that the ImageProperty returns are mapped to the entries of this Imagemap. The mapping is done with the help of the regular expression, which is assigned to every entry of the Imagemap.

Annotation: Under the name, there must be an Imagemap saved in the request.

 
labelPrefixString A optional prefix (HTML literal) which which can be prepended to all labels within the form. The prefix can be overwritten by a single formelement.

Annotation: A html literal.

 
labelSuffixString A optional suffix (HTML literal) which which can be appended to all labels within the form. The suffix can be overwritten by a single formelement.

Annotation: A html literal.

 
labelWidthString Specifies the label width.

Annotation: See HTML documentation for the attribute width.

 
localeString enables localization for the control element. String literals will be interpreted as keys in the Application.properties file.

Annotation: boolean value true oder false oder the name of a locale.

 
methodFormMethod Specifies the method using which the form should be sent.
  • get = The form is sent off via HTTP-Get. All the form fields are transferred in the URL.
  • post = The form is sent off with the HTTP-Post. All the form fields are transferred in the HTTP body.
 
nameString Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope.

When the tag is surrounded by a Struts <html:form> tag, no Bean Name need be specified. In this case, the Java-Bean is drawn via a property of the Struts Form Bean.

Annotation: A valid Java identifier must be given.

 
noframeBoolean Hides the forms frame and title  
permissionACL With this attribute, access to the element can be restricted.

Authorizations are checked using the com.cc.framework.security.Principal object in the user session. The principal object is registered in the session with the method com.cc.framework.security.SecurityUtil#registerPrincipal(HttpSession, Principal). It is made available by the application developer by implementing the principal interface. In this manner, any authorization system can be very easily connected within the framework.

Authorizations are always specified in the form of an Access Control List (ACL). What is involved here is a semicolon-delimited list with individual authorizations. The framweork supports the following authorization types, which, however, can be expanded at will by the application developer:

Literal
true|false -> com.cc.framework.security.StaticPermission
Role
#rolename -> com.cc.framework.security.RoleBasedPermission
Function
$functionname -> com.cc.framework.security.FunctionBasedPermission

 
propertyString Specifies the name of the property using which the Java-Bean is to be accessed. This is generally only necessary when the Java-Bean is associated with a Struts Form Bean.

Annotation: A valid Java identifier must be given.

 
scopeHTTPScope This attribute shows the Scope in which the Java-Bean with the actual display data can be found.
  • any = The Bean is searched for in ever Scope.
  • page = The Bean exists as a local variable in the JSP Page.
  • request = The Bean is in the HTTP-Request.
  • session = The Bean is in the HTTP-Session.
  • application = The Bean is in the Servletkontext.
 
styleString An HTML-style can be directly specified with this attribute.

Annotation: See HTML documentation for the attribute style.

 
styleClassString The HTML-class attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the attribute class.

 
summaryString This property can be used for rendering to non-visual media such as speech or Braille.  
transactionBoolean This flag directs the framework to append a transaction token to all generated hyperlinks. The transactio token allows the detection of form re-submissions (multiple submission of the same HTTP form).  
typeFormType Specifies the form type. The form type has effects on the depiction and the behavior of the form. Thus, in the case of a display-form, e.g,, all the form elements are depicted as Read-Only.
  • search = Search form. A corresponding icon is displayed in the title line of the form.
  • create = Input form for data record generation.
  • display = Display form. All form elements are depicted s Read-Only fields.
  • edit = Input form.
  • header = Special form of a display form.
  • info = Form for displaying notice texts.´ A corresponding icon is displayed in the title bar of the form.
widthString Specifies the width of the form window. The height may be specified in absolute or percent terms.

See HTML-Documentation

 

[ Example ]

Simple search form with two input fields.


<%@ taglib uri="http://www.common-controls.com/cc/tags-forms"   prefix="forms" %>

<forms:form type="search" caption="Client Search" formid="frmSearch">
    <forms:text  label="Client"  property="client"  size="11"  maxlength="10"/>
    <forms:text  label="Name"    property="name"    size="25"  maxlength="80"/>

    <forms:buttonsection>
        <forms:button  name="btnSearch"  src="images/buttons/btnSearch1.gif"/>
    </forms:buttonsection>
</forms:form>