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

Jochen Kemnade commented on TAP5-2099:
--------------------------------------

> I propose that literal and symbol bindings are sourced from a PerThreadValue 
> that can be updated by a mixin. 

As I have the same problem with read-only prop bindings, I'd like to propose 
the following:
Writes should only be allowed in the mixin's phases that come before the 
component's own rendering phase. For each mixin, a copy of the "incoming" value 
should be pushed down in a stack. In the mixin phases that come after the 
component, the respective values should be popped from the stack.
That way, you can apply multiple mixins to a component and each one reads the 
modified parameters from the one before but can never overwrite the values that 
come from the outside, even if they are mutable. The downside is that AFAICT 
parameter values would have to be copied which probably means that they need to 
implement Serializable.
                
> 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: binding, literal-binding, mixin, symbol-binding
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to