I feel strange asking a mailing list twice in a few days for help not in
understanding the concepts, but in plain old debugging. But I'm quite
frustrated. If someone has a moment to look at what *must be* a simple
error, I would appreciate it.
I'm getting a fairly standard exception:
wicket.markup.MarkupException: Unable to find component with id
'title' in [MarkupContainer [Component id = theForm, page =
com.thomson.bc.upload.CategoryDelete, path =
3:theForm.CategoryDelete$InputForm, isVisible = true, isVersioned
= true]]. This means that you declared wicket:id=title in your
markup, but that you either did not add the component to your page
at all, or that the hierarchy does not match.
But as far as I can tell, my hierarchy *does* match. Can you see
anything wrong with the following?
Thanks as always,
-- Scott
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:wicket="http://wicket.sourceforge.net">
<head>
<title>Delete Catgory Confirmation</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
<wicket:link><link href="test.css" rel="stylesheet"
type="text/css"/></wicket:link>
</head>
<body>
<form method="post" id="theForm" name="theForm" action="post"
wicket:id="theForm">
<p>The following guidelines are in this category, and will become
uncategorized:</p>
<ul>
<li wicket:id-"affectedGuidelines">
<span wicket:id="title">Guideline 1</span> -
</li>
<wicket:remove>
<li>Guideline 2</li>
<li>Guideline 3</li>
</wicket:remove>
</ul>
<p>Proceed anyway?</p>
<input type="image" wicket:id="cancelButton"
src="images/buttons/cancel_button.gif"/>
<input type="image" wicket:id="proceedButton"
src="images/buttons/save_button.gif"/>
</form>
</body>
</html>
import wicket.Page;
import wicket.markup.html.WebPage;
import wicket.markup.html.basic.Label;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.ImageButton;
import wicket.markup.html.link.IPageLink;
import wicket.markup.html.link.PageLink;
import wicket.markup.html.list.ListItem;
import wicket.markup.html.list.ListView;
import wicket.model.Model;
import wicket.model.PropertyModel;
import java.io.Serializable;
import java.util.List;
public class CategoryDelete extends WebPage {
public CategoryDelete(Category category) {
add(new InputForm("theForm", category));
}
public static PageLink link(final String name, final Category
category) {
return new PageLink(name, new IPageLink() {
public Page getPage() {
return new CategoryDelete(category);
}
public Class getPageIdentity() {
return CategoryDelete.class;
}
});
}
private static class InputForm extends Form {
private Category category;
private Category getCategory() {return category;}
public InputForm(String name, Category category) {
super(name, new Model(category));
this.category = category;
List affectedGuidelines =
DB.getInstance().getGuidelinesInCategory(category);
final ListView listView = new
ListView("affectedGuidelines", new Model((Serializable)
affectedGuidelines)) {
public void populateItem(final ListItem listItem) {
final Guideline guideline = (Guideline)
listItem.getModelObject();
Label label = new Label("title",
guideline.getTitle());
listItem.add(label);
}
};
add(listView);
add(new ImageButton("proceedButton") {
public void onSubmit() {
getCategory().delete();
getRequestCycle().setResponsePage(CategoryViewList.class);
}
});
add(new ImageButton("cancelButton") {
public void onSubmit() {
getRequestCycle().setResponsePage(new
CategoryEdit(getCategory()));
}
});
}
}
}
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user