You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Nicholas Stuart (JIRA)" <ta...@jakarta.apache.org> on 2005/07/08 20:19:10 UTC

[jira] Created: (TAPESTRY-390) Inconsistent behavior between Annotations and spec

Inconsistent behavior between Annotations and spec
--------------------------------------------------

         Key: TAPESTRY-390
         URL: http://issues.apache.org/jira/browse/TAPESTRY-390
     Project: Tapestry
        Type: Improvement
  Components: Framework, Annotations  
    Versions: 4.0    
    Reporter: Nicholas Stuart


There are some inconsitencys between how a annotated component and a component in a spec file are treated. The one that I've noticed is that if you try to access the component from with-in the page by using its name.

For example, if I have something like:

@Component(type="MyComponent")
public abstract IComponent getMyComponent();

And in your page you have:

<span jwcid="myComponent">
    <span jwcid="@Insert" value="myComponent.someProperty">Insert a value from the surrounding component "MyComponent"</span>
</span>

The above works fine (assuming someProperty is not null).

But, if you declare the component in the spec file using <component> it does not work. With or with out the abstract method in the class, the myComponent in "myComponent.someProperty" is always null. I would think that the behavior between Annotations and Spec files would be exactly the same, just differing where you declare the stuff.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (TAPESTRY-390) Inconsistent behavior between Annotations and spec

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-390?page=all ]
     
Howard M. Lewis Ship resolved TAPESTRY-390:
-------------------------------------------

    Resolution: Invalid
     Assign To: Howard M. Lewis Ship

If you want this behavior, use the property attribute of <component>. That not only creates the component, but injects it as a property.

The @Component annotation expressly defines the component and injects it as a property (because it is attached to an accessor method).

> Inconsistent behavior between Annotations and spec
> --------------------------------------------------
>
>          Key: TAPESTRY-390
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-390
>      Project: Tapestry
>         Type: Improvement
>   Components: Framework, Annotations
>     Versions: 4.0
>     Reporter: Nicholas Stuart
>     Assignee: Howard M. Lewis Ship

>
> There are some inconsitencys between how a annotated component and a component in a spec file are treated. The one that I've noticed is that if you try to access the component from with-in the page by using its name.
> For example, if I have something like:
> @Component(type="MyComponent")
> public abstract IComponent getMyComponent();
> And in your page you have:
> <span jwcid="myComponent">
>     <span jwcid="@Insert" value="myComponent.someProperty">Insert a value from the surrounding component "MyComponent"</span>
> </span>
> The above works fine (assuming someProperty is not null).
> But, if you declare the component in the spec file using <component> it does not work. With or with out the abstract method in the class, the myComponent in "myComponent.someProperty" is always null. I would think that the behavior between Annotations and Spec files would be exactly the same, just differing where you declare the stuff.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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