Custom Widgets
A widget as defined by the OJBC Console is a control used to collect data for a field in an object during the Create or Edit operations .
Examples of widgets include the Text, File, TextArea, AutoIncrement, Collection, and Reference widget.
You may associate widget's with data types or field descriptor's.
Briefly, field association is accomplished by modifying the ui_repository.xml file.
<field-descriptor name="body">
<!-- customize the widget for the field -->
<widget-descriptor id="textarea">
<!-- configure optional properties on the widget -->
<widget-param>
<name>rows</name>
<value>10</value>
</widget-param>
<widget-param>
<name>cols</name>
<value>40</value>
</widget-param>
</widget-descriptor>
</field-descriptor>
Read more about how to do this in the Widget Tutorial as well as
the configuration section on the ui_repository.xml
Available Widgets
Default Widgets
Text Field Widget
The default widget for most data types.
Optional Attributes
name
| datatype
| description
|
size |
Integer |
passed thru to the html |
maxlength |
Integer |
passed thru to the html |
Auto Increment Widget
The default widget for any field that is labeled as auto-increment=true in the repository.xml
Date/Time Widget
The default widget for a DATE, TIME, or TIMESTAMP based field in repository.xml
Optional Attributes
name
| datatype
| description
|
format |
string |
specifies the SimpleDateFormat "format" string that should be used to collect the date or time. |
Collection Widget
The default widget for any field that is associated with a collection descriptor in repository.xml (1-n, m-n)
Reference Widget
The default widget for any field that is associated with a reference descriptor in repository.xml (n-1)
Reference Widget
The default widget for any field that is associated with a reference descriptor in repository.xml (n-1)
File Widget
The default widget for any field that is associated with a BINARY, VARBINARY or LONGVARBINARY data type in the repository.xml (n-1)
Optional Attributes
name
| datatype
| description
|
formFile.fileName |
string |
specifies the attribute name of the field to insert the filename from the multipart/form-data. |
formFile.contentType |
string |
specifies the attribute name of the field to insert the content type from the multipart/form-data. |
formFile.fileSize |
string |
specifies the attribute name of the field to insert the file size of the multipart/form-data. |
Optional Widgets
Hidden Widget
A No-Op widget. This widget will not provide any user interface to gather the information and will use an HTML hidden
value to transmit whatever value already exists.
Text Area Widget
Displays an HTML text area. This is useful for providing a better user interface for fields that require a lot of text.
Optional Attributes
name
| datatype
| description
|
rows |
Integer |
passed thru to the html |
cols |
Integer |
passed thru to the html |
Uid
Generates a UID. This widget does not provide a user-interface, but instead generates a UID on create. Extend
this wiget to provide your own UID implementation.
CreateDate
Generates a Create Date. This widget does not provide a user-interface, but instead generates a timestamp on create.
ModifiedDate
Generates a Modified Date. This widget does not provide a user-interface, but instead generates a timestamp on create and/or update.
Copyright © 2003 Alexander Bibighaus et al. All rights
Reserved.