You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Radek Terber <ls...@post.cz> on 2009/01/12 11:36:24 UTC

Problem with cyclic including components

Hi all.

I'm  new in tapestry 5 and I have a problem with component including.
I have two components, each of them need to include the other (the
example is here):

First class:
public class RoleList extends AbstractGridFragment<Role> {

    @Component
    private  SearchRole searchRole;  

   @Inject
    private RoleAdminService roleAdminService;

    ... etc ...
}

Second class:
public class SearchRole {

    @Component(id = "roleList")
    private RoleList roleList;
   
    @Component(id = "searchForm")
    private Form searchForm;

    ... etc ...
}

The first component ("RoleList") is referenced from "Index" (only this
component - nothing else).

If the same structure was created as pages (injected using @InjectPage),
all was OK. But if I have changed it to components, I obtain exception.
I tried replace "@Component" annotation with "@InjectComponent" with the
same result.

I need solve this problem
Thanks for suggestions.


The exception:
---------------------
org.apache.tapestry5.ioc.internal.util.TapestryException
Component admin/role/Index:rolelist does not contain an embedded
component with id 'SearchRole'. Available components: add, clearSearch,
delete, detail, grid, if, refreshbutton, search.

location
    classpath: ...package.../pages/admin/role/Index.tml, line 8, column 33

<title>XXXX</title>
4 	</head>
5 	<body>
6 	<h2>${message:role-managemant}</h2>
7 	
8 	<t:component t:id="roleList" />
9 	
10 	<p> The current time is: ${currentTime}. </p>
11 	</body>
12 	</html>