You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Kristian Marinkovic (JIRA)" <de...@tapestry.apache.org> on 2007/09/21 09:16:50 UTC

[jira] Created: (TAPESTRY-1764) provide access to component parameters from within mixins

provide access to component parameters from within mixins
---------------------------------------------------------

                 Key: TAPESTRY-1764
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
             Project: Tapestry
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.0.6
            Reporter: Kristian Marinkovic


A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 

I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.

see threads:
http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1764) provide access to component parameters from within mixins

Posted by "Nick Westgate (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529328 ] 

Nick Westgate commented on TAPESTRY-1764:
-----------------------------------------

It would be nice if the core component library could be made more malleable in this way (and in general).
With parameters etc declared private and no accessors it's very hard to modify their behaviour, e.g. with mixins.

Cheers,
Nick.

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-1764
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-103) provide access to component parameters from within mixins

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-103:
--------------------------------------

    Issue Type: New Feature  (was: Bug)

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAP5-103
>                 URL: https://issues.apache.org/jira/browse/TAP5-103
>             Project: Tapestry 5
>          Issue Type: New Feature
>    Affects Versions: 5.0.15
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1764) provide access to component parameters from within mixins

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568216#action_12568216 ] 

Howard M. Lewis Ship commented on TAPESTRY-1764:
------------------------------------------------

My concern here is that if the binding is used in multiple components (considering a mixin as a component), and yet cached in different variables of those components, it could easily end up with different values.

Thus, the Form component evaluates its binding and stores a value in a local instance variable.  The Magic mixin updates an instance variable and pushes the change through the binding. Now the Magic mixin has one value in an instance variable, the Form has another.  Which one is right?

Do we scrap the idea of local instance variables to store binding values?  Well there's a lot of value in keeping that, such as limiting how many times a value has to be type coerced, and allowing for unbound parameters to still act like fields.

So I think we need a solution where the instance variables of the Mixin are linked to the instance variables of the containing component through some additional mechanism I'm not sure of yet.

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-1764
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-1764) provide access to component parameters from within mixins

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-1764:
-------------------------------------------

    Fix Version/s: 5.1

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-1764
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Kristian Marinkovic
>             Fix For: 5.1
>
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-103) provide access to component parameters from within mixins

Posted by "Robert Zeigler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636690#action_12636690 ] 

Robert Zeigler commented on TAP5-103:
-------------------------------------

I think Howard's idea of linking mixin parameters to component parameters sounds cool.  Could this be done as a set of chained bindings? So, the page has a property "foo" bound to the component a's "value" parameter.  Mixin B does something like:

@InheritParameter
private Object value;

Now, the binding is altered so that: 
  foo => mixinb.value => componenta.value

So a change to componenta.value would propagate to mixinb.value and from there be pushed to to the page's foo property?

This might break down with multiple mixins, unless you chained them all together, in the order that they're defined for the component, perhaps:

foo => mixina.value => mixinb.value => mixinc.value => componentd.value

Not sure how feasible this is.  
But this is definitely a crippling issue for mixins.  Mixins have the potential to be really cool, but as they stand now, they're only sorta cool, because many of the more interesting things you would want to do with them require access to the underlying component's parameters.

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAP5-103
>                 URL: https://issues.apache.org/jira/browse/TAP5-103
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.0.15
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1764) provide access to component parameters from within mixins

Posted by "Kevin Menard (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568265#action_12568265 ] 

Kevin Menard commented on TAPESTRY-1764:
----------------------------------------

Aforementioned thread: http://markmail.org/message/5gax6ms2tx5o3jbh

For the time being, I've got a binding that does what I immediately need.  I think letting mixins act as filters as described though could be a very powerful mechanism.  I'm even envisioning a follow-up to expansions that would make use of this, like so:

${someVar|newlines:mode=para|capitalize|truncate:max=400}

Obviously, another issue for another day and syntax subject to change.  I'm just trying to further define what I'd like to do.

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-1764
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1764) provide access to component parameters from within mixins

Posted by "Kristian Marinkovic (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568625#action_12568625 ] 

Kristian Marinkovic commented on TAPESTRY-1764:
-----------------------------------------------

my original intend was to create mixins that could use the parameters of the component to decide further actions. a very concrete example is a EnableDisable mixin that
would render only  the value of a disabled TextField (i know there is a disabled parameter but if enabled it will still render the whole input element; applications with many input fields and high traffic will profit from the reduced page size).

therefore i'd be more than satisfied to have an read-only access to the parameter binding from within a mixin. i'm aware that the value of the parameter could be changed by the component but that's ok with me :)  because the rendering phases (after/before and MixinAfter) give you a hint on whether the  value could have been changed by the component. 

for me mixins are a great way to add additional (maybe cross-cutting) behavior to a component regarding visual appearance and functionality on the client-side. I do not see mixins as a way to add business logic such as mentioned by kevin.... i think Validators and Translators are more suitable for this. 




> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-1764
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1764) provide access to component parameters from within mixins

Posted by "Kevin Menard (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568262#action_12568262 ] 

Kevin Menard commented on TAPESTRY-1764:
----------------------------------------

I meant to add in my two cents on this issue after raising a question about mixins on the user list.  The key point from that was the following:

"What I'm looking to do is is basically a value filter.  I'd like the mixin
to take the value, apply its filter, and pass on to the next mixin or
component in the chain.  I've actually got several other candidate
operations in mind as well (truncation, capitalization, URLification)."

In my case, I'm not actually looking to modify any bound values, so nothing would change behind the scenes -- I agree that that's a situation looking to explode and would be incredibly frustrating to debug.  What I want to do is intercept the supplied value from a mixin and then pass that value onto either the next mixin or component.  A read-only access to the bound value would get us half-way there, but there are obvious problems with mutable state.  While there are certainly a lot of problems that could arise there, enough sign posts have been placed by then that a mixin author really should know what he ought and ought not be doing.

> provide access to component parameters from within mixins
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-1764
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1764
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Kristian Marinkovic
>
> A mixin can't access the parameters of a component because the Bindings property of the InternalComponentResourcesImpl class is private and the respective interface does not provide a access method. 
> I was trying to create a mixin that would render only the value of a form element  (without the tags) when it was in a certain state. There also might be use cases where mixins are used to collect data from the components they are attached and therefore also needs access to the components parameters.
> see threads:
> http://www.nabble.com/Antwort%3A--T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487995.html
> http://www.nabble.com/-T5--how-to-read-the-value-of-a-component-parameter-within-a-mixin-tf4487597.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org