dWebSpec Dictionary
CONTEXT: descriptors->element->conversion-type




All Details Standard Only Platform Only
Structured Web info and helpTechnologies
 Home Page
 Product Page
 Download Page
 Feedback
Javascript Tree Menu

Results for:

 element.conversion-type 
Prev  Topic  Next

The standard html entries are presented as strings on the page. However, their values could be bound to other types of objects and primitives. These could be numeric, date or other types. The conversion type specification allows for the designation of such types. The dWebSpec standard types are listed below:

  • string (default)
  • byte
  • short
  • integer
  • long
  • float
  • double
  • date
  • collections

The standard types would ensure platform independence. However, if such independence is not needed, or else as specification matures, platform specific or custom types could or should be included.

 Seam  

Basic JSF Features 

SEAM Enhancements

The conversion enhancements provided by Seam is centered on selection category elements, like radioGroup and select elements.

The typical specification for selection would look like this.

ELEMENT DESCRIPTORS

id

caption

type

value

component-id

conversion-type

validators

formatter

required

visible

enabled

group-id

scope

deptId   select {bb.deptId}   string              
deptId {bb.depts[].deptName} options {bb.depts[].deptName}   string              

In this specification, a key/value set is specified for options and the selected item is the key. Both the input and the selection are string values; hence there is no need for conversion. This however leads to the violation DRY. Whenever there is need for selection from items from a group of specific object type, the objects must be converted to a suitable object type. On JSF platform, the object type of choice is of the type SelectItem.

The first two Seam enhanced conversion components, essayed to allow more flexibilities in the choice of objects used for options and selections.

s:convertEntity Allows using any entity component for options and selected item. As long as there is a label attribute or suitable toString method, and also as long as there is a primary identifier specified with the @id annotation. The necessary conversion from a string base web page selection to entity selection would be orchestrated by s:convertEntity component.
s:converEnum Allows using objects based on Java Enum type for options and selected item. As long as there is a label attribute or suitable toString method. The necessary conversion from a string base web page selection to entity selection would be orchestrated by s:convertEnum component.
s:convertDateTime Perform date or time conversions taking into consideration the Seam timezone
Prev Next