[ 
https://issues.apache.org/jira/browse/TAP5-2099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15158053#comment-15158053
 ] 

Barry Books commented on TAP5-2099:
-----------------------------------

My understanding of the binding interface is the set method's purpose is to 
implement the two way binding not to "store" the value. In other words it sets 
the value in the caller not the value in the field. The documentation does say 
"updates the value" but it's not clear what value it's referring to. In the 
case of literal and symbol the providers for the values are not interesting in 
the new value because they are not going to do anything with it anyway. 

The current implementation of AbstractBinding throws an error on set and 
perhaps that's appropriate but the question is should literal and symbol 
override that? While it's true you can't update the value provided by @Symbol 
the question is should that be an error or should it just not do anything. I 
can see how throwing an error might be technically correct  because you can't 
update the value but the fact is neither binding is interested in the updated 
value so I think these binding should just ignore the set and allow other 
things to update the parameter.

I'm sure there are other ways to fix this but I've tried the code above and it 
seems to work and I don't  think there is much risk because it does not really 
do anything other than not throw an error.

> Update parameters bound to literal: or symbol: from a mixin
> -----------------------------------------------------------
>
>                 Key: TAP5-2099
>                 URL: https://issues.apache.org/jira/browse/TAP5-2099
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.3.6
>            Reporter: Lance
>              Labels: bulk-close-candidate
>         Attachments: TAP52099-1.patch
>
>
> Currently, I cannot update a component component parameter that is 
> initialized with a literal: or symbol: binding from a mixin. If I try to 
> @BindParameter the param and change it's value, I get a "Binding %s is 
> read-only" exception (originating from AbstractBinding).
> I propose that literal and symbol bindings are sourced from a PerThreadValue 
> that can be updated by a mixin.
> My original need for this was to create a "SinglePage" mixin for the Grid 
> component which would set the rowsPerPage parameter to Integer.MAX_VALUE. I 
> can't currently do this because by default, the parameter is a symbol: 
> binding.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to