[
https://issues.apache.org/jira/browse/WICKET-3480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053749#comment-13053749
]
Juergen Donnerstag commented on WICKET-3480:
--------------------------------------------
>> I think this patch removes the support for IRenderable columns.
why do you think so? The patch doesn't remove it and the only implementation of
IRenderable is in PropertyRenderableColumn.newCell() which should still be
supported.
>> Can't we introduce AbstractPropertyColumn which extends from AbstractColumn
>> and deals with PropertyResolver and Co., and PropertyRenderableColumn,
>> PropertyTreeColumn extend from it ?
That another option of course if there is value in keeping AbstractColumn the
way it was. I'm not an expert of the tree implementation.
> org/apache/wicket/extensions/markup/html/tree/table/{PropertyRenderableColumn,PropertyTreeColumn}
> common code
> -------------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3480
> URL: https://issues.apache.org/jira/browse/WICKET-3480
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-extensions
> Affects Versions: 1.5-RC1
> Environment: all
> Reporter: Richard Emberson
> Assignee: Juergen Donnerstag
> Priority: Trivial
> Attachments: wicket-3480.patch
>
>
> org/apache/wicket/extensions/markup/html/tree/table/PropertyRenderableColumn
> and
> org/apache/wicket/extensions/markup/html/tree/table/PropertyTreeColumn
> both inherit from AbstractColumn
> and have the following very similar methods:
> In PropertyRenderableColumn
> @Override
> public String getNodeValue(TreeNode node)
> {
> Object result = PropertyResolver.getValue(propertyExpression, node);
> if (converter != null)
> {
> Locale locale = this.locale;
> if (locale == null)
> {
> locale = Session.get().getLocale();
> }
> return converter.convertToString(result, locale);
> }
> else
> {
> return result != null ? result.toString() : "";
> }
> }
> and
> In PropertyTreeColumn
> @Override
> public String renderNode(TreeNode node)
> {
> Object result = PropertyResolver.getValue(propertyExpression, node);
> if (converter != null)
> {
> Locale locale = this.locale;
> if (locale == null)
> {
> locale = Session.get().getLocale();
> }
> return converter.convertToString(result, locale);
> }
> else
> {
> return result != null ? result.toString() : null;
> }
> }
> One returns null and the other returns "" when result is null.
> Question 1: Can the two methods be merged?
> Question 2: Why null in one case and "" in the other?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira