[
https://issues.apache.org/jira/browse/TAP5-2099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15158923#comment-15158923
]
Barry Books edited comment on TAP5-2099 at 2/23/16 2:20 PM:
------------------------------------------------------------
I'm not sure I understand the scenario you are describing. The example I pasted
above
@Parameter(BindingConstants.SYMBOL + ":" +
ComponentParameterConstants.GRID_ROWS_PER_PAGE)
private int rowsPerPage;
is from the grid. If I create a mixin
@BindParamter
int rowsPerPage;
void BeginRender() {
rowsperpage = 10;
}
The grid will now use 10 as the rows per page. If you mean something else fork
the project and try it. Keep in mind the sample project I posted only works for
literals. The code in this thread works for symbols which is what the grid
uses. I've been running something like the above code for almost 3 years now
and I have not had any problems I think were caused by it.
Ops crossed comments again. The sample code posted on github tests both
<t:com test="prop:" t:mixins="test"/>
and
<t:com t:mixins="test"/>
Both work as expected. I can update the Github project to try it with a grid
but I have to head off to work now so it will take me a while to get to it.
was (Author: trsvax):
I'm not sure I understand the scenario you are describing. The example I pasted
above
@Parameter(BindingConstants.SYMBOL + ":" +
ComponentParameterConstants.GRID_ROWS_PER_PAGE)
private int rowsPerPage;
is from the grid. If I create a mixin
@BindParamter
int rowsPerPage;
void BeginRender() {
rowsperpage = 10;
}
The grid will now use 10 as the rows per page. If you mean something else fork
the project and try it. Keep in mind the sample project I posted only works for
literals. The code in this thread works for symbols which is what the grid
uses. I've been running something like the above code for almost 3 years now
and I have not had any problems I think were caused by it.
Ops crossed comments again. The sample code a posted on github tests both
<t:com test="prop:" t:mixins="test"/>
and
<t:com t:mixins="test"/>
Both work as expected. I can update the Github project to try it with a grid
but I have to head off to work now so it will take me a while to get to it.
> 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, 5.4
> Reporter: Lance
> Labels: patch
> 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)