Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-57
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: javaserverfowner
Reporter: jhook
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

Converters - Tied into PropertyResolver (EL)

Created: 11/Nov/04 10:03 AM   Updated: 25/Nov/10 06:42 PM   Resolved: 24/Nov/09 07:48 AM
Component/s: Uncategorized
Affects Version/s: 1.2
Fix Version/s: 2.0

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All

Issue Links:
Dependency
 

Issuezilla Id: 57
Tags:
Participants: Ed Burns, javaserverfowner and jhook


 Description  « Hide

I believe it would simplify things greatly if Converters were not dependent on
UIComponents in the API:

public java.lang.Object getAsObject(javax.faces.context.FacesContext context,
java.lang.String value)

public java.lang.String getAsString(javax.faces.context.FacesContext context,
java.lang.Object value)

The PropertyResolver API could then allow developers to simply plug in
converters into the struts config and allow auto-resolution of specialized
property types.

b = object we are mutating
p = property descriptor that we are setting
o = object to be assigned

if (p.type not within EL spec & p.type is not assignable from o.class) {
c = application.getConverterForType by p.type
if (c) { o = c.getAsObject(context, o.toString) b.p = o; }
}

This behavior is similar to the popular Jakarta Common's Bean Utils.

e.g. if my orderline has a Money property, just by having a type Money, if no
converter is assigned on the inputText, the PropertyResolver will auto-convert
the String input to a Money Object for that inputText's expression property.