You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Lance (JIRA)" <ji...@apache.org> on 2016/02/22 23:22:18 UTC

[jira] [Comment Edited] (TAP5-2099) Update parameters bound to literal: or symbol: from a mixin

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

Lance edited comment on TAP5-2099 at 2/22/16 10:21 PM:
-------------------------------------------------------

An empty setter doesn't solve the problem 

If a mixin is allowed to change a symbol / literal binding, you need somewhere to store the new value. Since components are singletons, so too are the bindings within them. This begs the question where to store the updated value without causing race conditions. This is why I was suggesting backing literal and symbol bindings with a PerThreadValue.

This approach works (I've tested it) but Thiago had issues with it. 

Perhaps bindings could undergo some form of initialization lifecycle? 


was (Author: uklance):
An empty setter doesn't solve the problem 

If a mixin is allowed to change a symbol / literal binding, you need somewhere to store the new value. Since components are singletons, so too are the bindings within them. This begs the question where to store the updated value without causing race conditions. This is why I was suggesting backing literal and symbols with a PerThreadValue. 

> 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)