Hi,
I'm very new to wicket and need some help with what I thought is very
straight forward code.
Wicket Version 1.4.3
Code:
---------- Html -----------------
<form wicket:id="dataForm">
Grouping: <select wicket:id="grouping" size="6"></select>
Additional Remarks:
<textarea wicket:id="additionalRemarks" name="additionalRemarks"></textarea>
<input type="submit" value="In Process" />
</form>
---------- Java --------------
Form dataForm = new Form("dataForm") {
@Override
protected void onSubmit() {
System.out.println("Form 4 submitted");
}
};
dataForm.add(new TextArea("additionalRemarks", new
Model("additionalRemarks")));
List<String> groupings = Arrays.asList("Group 1", "Group 2");
DropDownChoice grouping = new DropDownChoice("grouping", groupings);
dataForm.add(grouping);
add(dataForm);
When I visit my page, I keep getting the error:
----------- Error ---------------------
WicketMessage: Unable to find component with id 'grouping' in
[MarkupContainer [Component id = dataForm]]. This means that you declared
wicket:id=grouping in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.
It points to <select wicket:id="grouping" size="6"> in my html.
Removing the select lets the page render correctly.
Is the error caused by me adding a DropDownChoice component to a Form? I've
looked at the web examples and they dont seem to have a problem and yet my
simple select form cannot run. Did I misunderstand the component hierarchy?
DropDownList cannot be added to a Form?
Help will be appreciated.