> On 8 Jul 2015, at 21:32, Brett Ryan <[email protected]> wrote:
>
> Nicolas Le Bas <mail@...> writes:
>
>> I've been looking at this pull request, and I like it. I understand its
>> value, but it raises a number of interesting challenges and questions.
>>
>> *Summary*
>>
>> Brett wants to support evaluation of expressions in the attributes of
>> <item>.
>
> Thankyou. To be precise, I'm looking for evaluations of expressions on any
> attribute that can contain multiple values. mck's solution that
> `add-list-attribute` can be used, while verbose is sufficient, however;
> presently an NPE is being thrown on the use of the `expression` attribute on
> `add-list-attribute`.
I've tracked down the NPE to two things. First, if Attribute has a null value,
it returns the value null, which IMHO is something I discourage, toString
should always be a string representation of a value, not null, alternatives
would be "null" or "(null)".
While this is the cause of the NPE, I've now found that uses of `<add-attribute
expression="${some.val}"/>` within `<add-list-attribute>` are presently not
supported.
I shall attempt an enhancement to support this but due to the way tiles is
structured it would ultimately be returning nested copies of lists which is
similar to my original solution (with the added nesting for child properties).
I would like to complete this sooner but might not be able to provide something
before the weekend. Is there a preferred branch? I was going to submit this on
the 3_0_X branch.
Also, I've only created a few pull requests in the past for other projects,
what's the best practice for submitting an enhancement? I've created a new
branch rooted at commit cc11955, but I'm not sure how to create a pull request
from that, will need to test, sorry.
-Brett