You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Christian E Gruber (JIRA)" <de...@tapestry.apache.org> on 2007/11/24 19:33:43 UTC

[jira] Commented: (TAPESTRY-1931) Add an annotation to allow explicit setting of property types

    [ https://issues.apache.org/jira/browse/TAPESTRY-1931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545204 ] 

Christian E Gruber commented on TAPESTRY-1931:
----------------------------------------------

My only concern with this is if it becomes too view-centric within your model classes.  however, I think sufficient decoupling is allowed by having a richer set of types than String would normally allow, as you have done here.

Frankly, as long as the view can treat this as a set of hints by which it can provide sane default views, that's great.  And if it can override the display in the view, then even better.

I do think this will simplify development, however, as I think sane defaults are achievable, and these two types are probably most of what's needed.  

What would be best, though, is if these mechanisms were extensible, so you could contribute new bean types and default renderings.

> Add an annotation to allow explicit setting of property types
> -------------------------------------------------------------
>
>                 Key: TAPESTRY-1931
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1931
>             Project: Tapestry
>          Issue Type: New Feature
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Howard M. Lewis Ship
>
> Currently, there's a fairly simple mapping from Java property type to Tapestry property type ... the latter being a string used to select appropriate components to display the value of a property or edit the value of a property.
> However, type is not always enough.  For example, String and Number both map to "text", but a String could also be a long text field (use a <textarea>) or perhaps a rich text field (we will eventually add a rich text editor to Tapestry).  Likewise, Date maps to "date" but that doesn't allow for time input, just the date portion.
> How about:
> public class MyBean {
>   private String _password;
>   private String _note;
>   public String getPassword() { return _password; }
>   @PropertyType("password")
>   public void setPassword(String password) { _password = password; }
>   public String getNote() { return _note; }
>   @PropertyType("longtext")
>   public void setNote(String note) { _note = note);
> }

-- 
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