You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/01/17 19:16:34 UTC

[jira] Commented: (TAPESTRY-1598) Tapestry should not require explicit value encoders (via the encoder parameter) where it can automatically coerce the value between string and the appropriate server-side type

    [ https://issues.apache.org/jira/browse/TAPESTRY-1598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560018#action_12560018 ] 

Howard M. Lewis Ship commented on TAPESTRY-1598:
------------------------------------------------

Ah the joys of TypeCoercer.  If you have a type that does not have a natural coercion to and from string (for example, a database entity type) you will see ugly strings on the client and failure when the form is submitted. 

> Tapestry should not require explicit value encoders (via the encoder parameter) where it can automatically coerce the value between string and the appropriate server-side type
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1598
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1598
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.5
>            Reporter: Nick Westgate
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> (This could be considered an enhancement except that it worked in a previous snapshot.)
> Summary says it all but here's a simple example:
> html:
> <select t:type="select" t:value="someIntegerProperty" t:model="selectModelList"></select>
> java:
> 	public List getSelectModelList() // note list is currently broken as per TAPESTRY-1597
> 	{
> 		List<Integer> model = new ArrayList<Integer>();
> 		model.add(new Integer(1));
> 		model.add(new Integer(2));
> 		return model;
> 	}
> Now results in the following exception:
> org.apache.tapestry.ioc.internal.util.TapestryException
> No adapter from type java.lang.Integer to type org.apache.tapestry.services.ValueEncoderFactory is available (registered types are java.lang.Enum, java.lang.String).
> Defining ValueEncoders for all the simple wrapper types used in domain objects defeats the purpose of all the smart type conversion Tapestry does elsewhere.
> Cheers,
> Nick.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org