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

Ognen Ivanovski commented on TAPESTRY-1931:
-------------------------------------------

Tagging something with a property type of 'password' or 'currency' is actually 
quite something the domain model should be concerned about, its' not that 
view-centric.

Tag annotations could also be used here: 

@Password
 public void setPassword(String password) { _password = password; } 

Also, please allow third parties to be able to examine the class under 
investigation and have a say on the property type. Trails does this nicely with 
enabling you to write rules such as "type is password if property name ends 
with password". 



> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to