[forge-issues] [JBoss JIRA] (FORGE-389) Property creation needs to update toString
Richard Kennard (Commented) (JIRA)
jira-events at lists.jboss.org
Sun Dec 4 16:52:40 EST 2011
[ https://issues.jboss.org/browse/FORGE-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647879#comment-12647879 ]
Richard Kennard commented on FORGE-389:
---------------------------------------
Perfect for me, thanks!
> Property creation needs to update toString
> ------------------------------------------
>
> Key: FORGE-389
> URL: https://issues.jboss.org/browse/FORGE-389
> Project: Forge
> Issue Type: Feature Request
> Reporter: Richard Kennard
> Assignee: Lincoln Baxter III
> Fix For: 1.0.0.Beta4
>
>
> There are a number of places in the UI (for example, as OPTIONS inside a SELECT box) that a textual representation of an entity's value is required. I'm open to how this should be done, but something like 'whenever a property is added to an entity, it is also added to the entity's toString() method' would suffice for my purposes.
> Bonus points for limiting it to 'only required fields' or 'only the first 5 fields' :)
> For example:
> public class Customer {
> public String getFirstname() {...}
> public void setFirstname( String firstname ) {...}
> public String getSurname() {...}
> public void setSurname( String surname ) {...}
> public String toString() {
> StringBuilder builder = new StringBuilder();
> builder.append( firstname );
> builder.append( ' ' );
> builder.append( surname );
> return builder.toString()
> }
> }
> Strictly speaking this could be managed by the JSF Converter's 'getAsString' method, but I think it would be better in the Entity class?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the forge-issues
mailing list