Hi,
I have two enclosure with one closing another one like this:
*<wicket:enclosure child="userType">
<table>
* <tr>
<td></td>
</tr>
* <wicket:enclosure child="post">
* <tr>
</tr>
</wicket:enclosure>
<div wicket:id="noPostLabel"></div>
</table>
</wicket:enclosure>
Here is the java code:
*ListView<UserTypeDomain> userTypeDomainListView = new
ListView<UserTypeDomain>("userType", userTypeDomainList)
{
*
@Override
protected void populateItem(ListItem<UserTypeDomain> item)
{
item.add(new Label("organization", new
PropertyModel<UserTypeDomain>(item.getModel(), "organization"))); // (4)
int organizationId =
((UserTypeDomain)item.getModelObject()).getOrganizationId();
List<PostDomain> postDomainList = null;
postDomainList =
postService.getPosts(organizationId, unitId, batchId,
locationId, iModel.getObject().getKey());
}
// user posts in each user type
* ListView<PostDomain> postDomainListView = new
ListView<PostDomain>("post", postDomainList)
{
*
@Override
protected void populateItem(ListItem<PostDomain> item)
{
String post =
((PostDomain)item.getModelObject()).getPost();
item.add(new Label("text", post));
}
};
postDomainListView.setVisible(!postDomainListView.getList().isEmpty());
add(postDomainListView);
Label noPostLabel = new Label("noPostLabel", "No posts
shared till now...!!!");
noPostLabel.setVisible(!postDomainListView.isVisible());
add(noPostLabel);
}
};
userTypeDomainListView.setVisible(!userTypeDomainListView.getList().isEmpty());
add(userTypeDomainListView);
this.createModelForUserType();
}
Now, when there is no user type, then the code works fine but when there is
a type but no posts are there..i.e. inner enclosure tab is called, then the
error comes:
Root cause:
*org.apache.wicket.WicketRuntimeException: Could not find child with id:
post in the wicket:enclosure*
at
org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:249)
at
org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:228)
at
org.apache.wicket.markup.html.internal.Enclosure.onInitialize(Enclosure.java:133)
at org.apache.wicket.Component.fireInitialize(Component.java:932)
....
I am not able to understand...is there any syntax mystake. I have read that
it was a bug in earlier versions of wicket but I am using 1.5. Please help
me what is causing this error...?
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Wicket-cannot-find-id-in-inner-enclosure-but-has-no-problem-in-outer-one-tp4559666p4559666.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]