[ 
https://issues.apache.org/jira/browse/TAP5-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jens Breitenstein reopened TAP5-1623:
-------------------------------------


Howard, 

I apologize for the typo in my example. even nothing prevents a setter from 
returning a value you are correct in telling it should not. 
but closing the bug is of no help because changing my sample code to use void 
as result type does not change the broken behaviour: the setter is still not 
called.
please check yourself with the test sources below

----------

TestSetterComponent.java

import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;

public class TestSetterComponent
{
        @Parameter(required = true)
        @Property(write = false, read = true)
        private String _text;

        public void setText(final String text)
        {
                System.out.println("DO WHATEVER YOU WANT HERE IN THIS METHOD");

                _text = text + "-SETTER-CALL";
        }
}

-----------------

TestSetterComponent.tml

<t:container
        xmlns="http://www.w3.org/1999/xhtml";
        xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
        xmlns:p="tapestry:parameter">

    <t:if test="text">
        <t:outputraw value="text"/>
    </t:if>

</t:container>

--------

usage:

        <t:TestSetterComponent text="literal:SAMPLE"/>

results in 

SAMPLE

because the setter is never called. Personally I would expect 
SAMPLE-SETTER-CALL as result.

                
> @Parameter and @Property mutually exclusiv?
> -------------------------------------------
>
>                 Key: TAP5-1623
>                 URL: https://issues.apache.org/jira/browse/TAP5-1623
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Jens Breitenstein
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> in case a @parameter annotation is used in conjunction with @property the 
> property setter is never called.
> the framework should either support it or reject such a combination of 
> annotations.
> sample: 
> @Property(read = true, write = false)
> @Parameter(required = true)
> private String _myParam;
> // ---->> NEVER CALLED
> public void String setMyParam(final String param)
> {
>     _myParam = param;
>     // do more...
> } 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to